The action takes place in Milan and Como, in 1176. Milan is threatened by Federico Barbarossa's troops. Among the defenders of the city Rolando appears and warmly greets Arrigo from Verona, whom he had thought killed in a battle. Arrigo once again sees Lidia, who had been his fiancée, but who now by the will of her father has married Rolando. Arrigo, accepting his destiny, becomes one of the Cavaliers of Death, to Lidia's great chagrin; she sends him a letter to try to dissuade him. Rolando is getting ready to go into battle when he is approached by Marcovaldo, a German prisoner, in love with Lidia. He gives Rolando Lidia's letter. Rolando's indignation flares into revenge: discovering Lidia and Arrigo in conversation, he seizes Arrigo and locks him in the tower. That way, Arrigo will not be present for the role-call of the Cavaliers of Death and will thus be dishonoured. In despair, Arrigo jumps out of the tower window into the river below. While Lidia and the other Milanese women pray for their soldiers, news comes of the defeat of Barbarossa. The Lombards return victorious; among them is Arrigo, mortally wounded. The young man exculpates Lidia, then expires clutching the Carroccio banner to his breast.
The subject was proposed by the Neapolitan librettist Salvatore Cammarano, who wanted to see the opera performed in his home town . But relations between Verdi and the San Carlo Theatre had difinitively soured, and Verdi felt he was free from any commitment he may have had with Naples. But not so with poor Cammarano his economic situation was disastrous. In 1848 the music was finished and on January 27th, 1849, La battaglia di Legnano was first performed at the Argentina Theatre in Rome. The censors changed the name of the opera to L'assedio di Arlem e Lida for succeeding productions given in other Italian theatres.