Act I. The action takes place in the middle of the 5th century in Aquileia. The city has been badly ravaged by the invasion of the Huns commanded by the fierce Attila: the night is lit up by the torches and the fires still burning in the town. A great number of Huns and Ostrogoths pay homage to their leader. Uldino, a young Breton slave of Attila's, presents to the victor a group of virgins from Aquileia spared from the massacre after having fought courageously beside their fathers and brothers: among these is Odabella, who had seen her father killed and who believes dead Foresto, the man she loved, as well. Attila, smitten by her beauty and her proud words, falls in love with her and gives her his sword, ordering that together with the other virgins, she be taken to the camp to become part of his court. Odabella belts on Attila's sword, pretending to submit to the invader's will, but she plans her revenge. As the women are taken away, Ezio, a valiant Roman general, is brought forward. He hates the young emperor Valentiniano, and comes to offer his help to Attila for his future campaigns, in exchange for the command over Italy. Attila refuses indignantly any compromise: he plans to conquer Rome and the rest of Italy through force. Troubled, Ezio answers that if Attila will not have him as an ally, he will have him, as in the past, as a valiant enemy on the field of battle.
At Rio Alto, in the Adriatic lagoons, the Hermits live in huts built on piles. They joyously take in the men and women from Aquileia, making plans to rebuild the city stronger and more beautiful. The new city shall also be built on piles, where the Hermits' simple huts now stand.
Act II. The woods near Attila's camp. It is night; Odabella is mourning her father and her beloved Foresto, when the latter arrives, having managed to come to her despite the great danger. The young man thinks that Odabella has been unfaithful and attacks her bitterly, reminding her of the homeland destroyed, her father killed and their past love. But Odabella desperately defends herself against Foresto's accusations: she will be like Judith, who saved Israel by killing Holofernes. This is the reason she agreed to follow Attila and is wearing his sword. With this sword she will avenge the homeland, killing the invader. Repentant, Foresto embraces Odabella, pledging his love to her.
Attila's tent. The commander sleeps, guarded by Uldino. But suddenly, he awakes, terrified by a nightmare: he dreamt that an old man, coming toward him, prohibited him from entering Rome, land of the gods, not of common mortals. But Attila soon recovers, and, calling his captains, orders the trumpets to sound for the march on Rome. The trumpets barely start to squeal, when a mystic chorus is heard approaching. From the hills descends a long column of Roman virgins and young men. At their head is Pope Leo, the old man Attila had dreamt of: he repeats the fatal words of the dream. All present are shocked and terrified, Attila more than anyone else. He prostrates himself before the Pope, giving up his plan to conquer Rome.
Act III. Ezio's camp near Rome. The Roman general angrily reads a letter from the emperor Valentiniano, announcing a truce with the Huns and ordering him to return to Rome. He dreams of rebuilding Rome to its ancient splendour, taking the command away from the weak youth. A Hun delegation arrives, inviting Ezio to Attila's camp. Among these is Foresto in disguise. When alone with Ezio, he tells him that Attila will be killed that very day: the Roman troops should be ready. When they see a signal fire on the hill they should fall on the Huns, who, without their leader, will be beaten back in a short time.
Attila's camp. In the night illuminated by torches a solemn banquet is being prepared. Attila, with his followers, receives Ezio and invites him to agree to a truce. Suddenly a wind comes up that extinguishes most of the torches: hidden, Foresto informs Odabella that in the cup from which Attila will soon drink Uldino has put a potent poison. But just as Attila raises the cup to his lips, Odabella, who wants her enemy killed by her own hand and not by the betrayal of one of his own, tells Attila there is poison in the cup. Foresto claims he has done it, and his life is spared only because Odabella asks it of Attila in exchange for her warning. While Attila announces his plans to marry Odabella, now worthy of him, the next day, as well as his intention to resume his fight against Rome, Foresto curses Odabella for what he believes to be a horrendous betrayal. In vain the young girl implores him to escape, assuring him that in a short time he will have good reason to fully pardon her.
In the woods that separate Ezio's camp from Attila's, Foresto waits for Uldino to bring him news of the marriage of Attila and Odabella. Uldino announces that the procession is accompanying the bride to the commander's tent. The Roman troops are ready just beyond the woods, and Foresto tells Uldino to give them the signal to attack. While the young man continues to curse Odabella's betrayal, with useless invitations by Uldino to stay calm, Odabella herself arrives, having escaped from the barbarians' camp. Furious, Attila follows close behind, but he is blocked by three enemies: Odabella reminds him of her dead father, Foresto, the fatherland and his love destroyed and Ezio, all the crimes and destruction he has caused all over the world. As the noise of the Roman assault on Attila's camp reaches them, Foresto lunges forward to stab Attila, but not before Odabella, with the sword given her by Attila, finally manages to take out her revenge.
In the romantic atmosphere of the times, Verdi had read an article by Madame de Staël, De l'Alemagne, which contained a summary of Zacharias Werner's play, Attila, König der Hunnen. The librettist Andrea Maffei (who later on wrote the libretto for I Masnadieri) gave Verdi the idea of a "barbarian" subject, and the Maestro, with his readings still fresh in his mind, started to work adapting Werner's drama. Temistocle Solera, was given the task of transposing the work into verse, while Verdi chose the Fenice Theatre in Venice as the place to perform it for the first time. The libretto was slow in arriving, however, because Solera, in the Spanish capital where he had moved, was deeply in debt and did not send the last scenes of the libretto. Verdi decided to ask Francesco Maria Piave to complete the text, and on March 17th, 1846, Attila was performed, a moderate success.