Žerajić and Špiro Soldo were leaders of the secret society "Freedom" established in 1905/1906. Žerajić's friendship with Vladimir Gaćinović and his attempted assassination of Varešanin additionally inspired the members of the revolutionary movement Young Bosnia, including Gavrilo Princip. Gaćinović was the real ideologue of the revolutionary movement Young Bosnia and advocated tyrannicide as a method of political struggle. Some authors, including Vladimir Dedijer, emphasize that the basis for this method of political struggle is the cult of "Kosovo tyrannicide". Žerajić was first to apply this method in the practice. When Franz Joseph I of Austria visited Bosnia and Herzegovina on 3 June 1910, Žerajić had intention to attempt his assassination during his visit to Mostar, but eventually gave it up from unknown reason.
Žerajić decided to assassinate General Marijan Varešanin, the Governor of Bosnia and Herzegovina, after he read an article written by Risto Radulović, who argued against dispiritedness in the public life of Bosnia and Herzegovina. In his article, Radulović explained that he did not see glorious moments of the nation nor a single tragedy which he believed was necessary to temper the struggle. When Žerajić read these words he yelled "There will be a tragedy!". On 15 June 1910, Žerajić attempted to assassinate Varešanin on the day of opening of the Austro-Hungarian Diet of Bosnia because he believed it was illegal and illegitimate. He shot at Varešanin five times, and missed. With his last, sixth, bullet Žerajić killed himself. Before he died, he said that he expected that Serbdom would avenge his death. His action brought Young Bosnia to the public attention.
Reactions
Žerajić's attempt of assassination had a significant influence on young people of Bosnia and Herzegovina. After this attempt new revolutionary circles were established in Sarajevo, Mostar, Tuzla and Banja Luka. An evening before the assassination of Archduke Franz Ferdinand of Austria, Gavrilo Princip, Čabrinović and Ilić visited the grave of Žerajić for the last time. Žerajić's proclamation "He who wants to live, let him die. He who wants to die, let him live", was quoted by Gavrilo Princip in one of the songs he wrote. The official press in Bosnia and Herzegovina and most of the newspapers from Serbia described Žerajićs attempt as action of disturbed maniac. The older generation of Serbs in Sarajevo had similar position.