Kočić left Gomionica after two years and completed his primary education at the Eastern Orthodox religious school in Banja Luka, though he returned to the monastery every summer in order to spend time with his father. Kočić was the best student in his class at the religious school, and upon graduating in 1891, he departed for Sarajevo to attend high school at the First Sarajevo Gymnasium. During his first three years, he excelled in subjects such as mathematics, as well as Greek, Latin, German and Serbo-Croatian, which the Austro-Hungarians deemed the "language of the land" ("zemaljski jezik"), so as not to become entangled in local ethnolinguistic disputes. Kočić experienced a violent fit in his fourth year, swearing at a theology teacher and throwing a textbook at him over a poor grade. He was dismissed from the classroom and subjected to a monetary fine. According to a classmate, the outburst changed Kočić, "turning him from an ambitious, disciplined student, into a truant and frequenter of "kafanas" and bars." Following an incident in which a visibly intoxicated Kočić and his friends verbally abused Muslim students in a hotel bar, Kočić was expelled from the Gymnasium. He found himself unable to enroll into any of the high schools in Bosnia, having apparently drawn the ire of the Austro-Hungarian authorities. Kočić was forced to continue his education in neighbouring Serbia and enrolled into a Belgrade high school, from which he graduated in 1899.