The song was written initially in
Czech by the Slovak
Lutheran minister Samuel Tomášik while he was visiting
Prague in 1834. He was appalled that
German was more commonly heard in the streets of Prague than
Czech. He wrote in his diary: :"If mother Prague, the pearl of the Western Slavic world, is to be lost in a German sea, what awaits my dear homeland, Slovakia, which looks to Prague for spiritual nourishment? Burdened by that thought, I remembered the
old Polish song Jeszcze Polska nie zginęła, kiedy my żyjemy ("Poland has not yet perished as long as we live."). That familiar melody caused my heart to erupt with a defiant
Hej, Slováci, ešte naša slovenská reč žije ("Hey, Slovaks, our Slovak language still lives")... I ran to my room, lit a candle and wrote down three verses into my diary in pencil. The song was finished in a moment."
(Diary of Samuel Tomášik, Sunday, 2 November 1834) Tomášik left the instructions for his song to be performed to the melody of ''Dąbrowski's Mazurka
: "It be sung as: Poland has not yet perished''". which was also the Yugoslav national flag from 1918 to 1941 and from 1992 to 2006. He soon altered the lyrics to include all Slavs and "Hey, Slavs" became a widely known rallying song for Slav nationalism and Pan-Slavic sentiment, especially in the West Slavic lands governed by
Austria. It was printed in numerous magazines and calendars and sung at political gatherings, becoming an unofficial anthem of the Pan-Slavic movement. Its popularity continued to increase when it was adopted as the organizational anthem of the
Sokol ("falcon") physical education movement, which was based on Pan-Slavic ideals and active across
Austria-Hungary. In 1905, the erection of a
monument to the
Slovene poet
France Prešeren in
Ljubljana was celebrated by a large gathering of people singing "Hey, Slavs". During the
First World War, the song was often used by Slavic soldiers from opposite sides of the front line to communicate common nationalist sentiment and prevent bloodshed. In Slovakia, the song "Hey, Slovaks" has been considered the unofficial ethnic anthem of the Slovaks throughout its modern history, especially at times of revolution. Although after the First World War the song "
Nad Tatrou sa blýska" became the official Slovak part in the national anthem of
Czechoslovakia and then again in 1993 in anthem of independent Slovakia, "Hey, Slovaks" is still considered a "second" national anthem by many (usually more nationalistic) people. Contrary to popular assumption, there was no official state anthem of the
clerofascist Slovak Republic (1939–45), though "Hej, Slováci" was used by the ruling party. ==Yugoslavia==