Ottokar Kernstock was born Otto Kernstock on 25 July 1848 in Marburg an der Drau (today Maribor in Slovenia), his mother's home town. His father came from Prachatitz in the Bohemian Forest and was an imperial finance official. When the father was transferred to Graz in 1855, the family moved. In Graz Kernstock went to school, began studying law and became a member of the academic singing society “Gothia”.
In 1867 he entered the canons' abbey of Vorau and took the religious name Ottokar. He was ordained a priest in 1871 and then served as archivist and librarian of the abbey, later as curate in several parishes. From 1889 until his death he was parish priest of Festenburg in eastern Styria. His poems appeared in the Munich “Fliegende Blätter” from 1878, and the volume “Aus dem Zwingergärtlein” (1901) made him widely known. His friend Peter Rosegger enjoyed a similar fame. In 1919 the University of Graz awarded him an honorary doctorate, and in 1920 he received the Mejstrik Prize together with Rainer Maria Rilke. According to biographical reference works, Kernstock's poetry is patriotic and German-nationalist. During the First World War he wrote war poetry, among it the volume “Steirischer Waffensegen” (1916), published with Rosegger. Karl Kraus sharply criticised these verses and quoted them in “Die letzten Tage der Menschheit”. When Kernstock was offered a post at the teachers' academy of the Wiener Pädagogium in 1916, he finally stayed in Festenburg. His text “Sei gesegnet ohne Ende” became the national anthem of the First Republic in the late 1920s. In 1923 Kernstock wrote the “Hakenkreuzlied” for the Fürstenfeld local branch of a National Socialist party. He himself declared afterwards that he was “no Hakenkreuzler” and had only written a poem about the party's original aims. That his name and his poem were used for National Socialist campaigning is part of his legacy.
Kernstock died on 5 November 1928 in Festenburg, where a museum now remembers him. About 60 streets, squares and other public spaces were named after him after his death, some of them later renamed.
