The legend of the Poljica girl Mila Gojsalić from Kostanje lives in the oral tradition of the Poljica region. According to the legend, during one attack by the Turkish army on Poljica (probably in 1530), she decided to go to the enemy camp, seduce the Turkish pasha, ignite the gunpowder storage, and thus kill the Turkish army, the pasha, and herself. Poems about her were written by August Šenoa, Drago Ivanišević, Niko Anrijević, Juraj Kapić, Juraj Marušić, Ivan Tadin, and she was also the subject of paintings by Mirko Rački and Ante Starčević.
Although the figure of a young girl appears in other Croatian heroic operas, Mila is the only active heroine and the only female character whose goal is to protect her homeland.
After operas such as "Morana," "Ero the Joker," and "Kamenika," Jakov Gotovac began work on the historical musical drama titled "Mila Gojsalića" in 1948. He completed the score with a libretto by Danko Anđelinović in 1951, and the work premiered on May 18, 1952, under the composer's direction at the Croatian National Theatre in Zagreb.
The element of the folk legend strongly influenced the characterization of the opera's characters: brave and honest protagonists led by the young Mila are opposed to the violent Ottomans led by Topan-paša. Some critics note that Gotovac and Anđelinović chose a biblical theme because the legend of Mila reflects Marulić's "Judith," making Mila an archetype of a martyr who dies for her faith. Although she sacrifices herself for the good of her homeland, the titular heroine is not politically motivated; her actions are based on personal integrity, emphasizing the importance of personal morality. This is most evident in the first part when young Mila willingly chooses to go to the infamous Topan-pasha instead of escaping with her beloved fiancé. Gotovac conveys her determination through intentionally softer music, encouraging the audience to pay attention to the heroine. "Oda zemlji" (Ode to the Land), Mila's most famous aria, successfully expresses her love for her homeland, readiness for sacrifice, and faith.