In the mid-7th century, Lombardy has been torn apart by war. The former king divided his kingdom between his sons, giving Milan to Bertarido and Pavia to Gundeberto. But brother warred against brother, and Gundeberto enlisted Duke Grimoaldo as an ally, promising him the hand of his sister Eduige. As the opera opens, Gundeberto has been killed through Grimoaldo's treachery. Bertarido has fled and is presumed dead, leaving his wife Rodelinda and son Flavio in the power of Grimoaldo, who has seized the throne. Eduige, in mourning for her brothers, has postponed the wedding with Grimoaldo. No one knows Bertarido is alive except his friend Unulfo, who is also an advisor to Grimoaldo.
Grimoaldo offers the grieving Rodelinda a chance to regain the throne by marrying him. She indignantly refuses. Egged on by his henchman Garibaldo, Grimoaldo jilts Eduige. Garibaldo, who has his own designs on the throne, worms his way into Eduige's affections; she is open to his advances if he will help her punish Grimoaldo.
Bertarido, who has returned in disguise, contemplates his own memorial and longs for his wife. Unulfo joins him and insists that Bertarido remain in hiding; not even Rodelinda can know he is alive. The pair hide as Rodelinda and Flavio arrive at the tomb. Rodelinda's laments for her husband are interrupted by Garibaldo, who delivers an ultimatum: her son will be killed unless she marries Grimoaldo. Rodelinda capitulates, swearing she will have Garibaldo's head once she is queen, and unaware that Bertarido is a shocked witness to her apparent disloyalty.
As Garibaldo and Eduige plot to gain the throne, Garibaldo senses that Eduige still loves Grimoaldo.
Rodelinda sets one condition before she will marry Grimoaldo: he must personally kill her son in front of her, for she cannot be both wife to the usurper and mother to the rightful king. This breathtakingly audacious bluff sends Grimoaldo into an emotional tailspin. He cannot bring himself to kill Flavio, and Rodelinda's implacable fidelity makes him love her more than ever. The unscrupulous Garibaldo urges Grimoaldo to call her bluff.
While out for a walk, Eduige chances upon Bertarido and recognizes him. When Bertarido tells her he wants only his family, not his kingdom, she resolves to help him. She and Unulfo reassure him of Rodelinda's loyalty.
Unulfo brings Bertarido to Rodelinda, but no sooner have the couple been reunited than Grimoaldo arrives. He doesn't recognize Bertarido and is furious at Rodelinda's apparent hypocrisy: not only has she scorned his offer of marriage, but she has taken a lover. To save her honour, Bertarido reveals that he is her husband, but Rodelinda, desperate to protect him, insists that he is lying. Grimoaldo declares that as the man is either his enemy or his rival in love, he will be executed. He leaves the couple to make their final farewells.
Eduige and Unulfo plot Bertarido's escape from prison. Eduige throws a sword into Bertarido's cell. When someone enters, he strikes, wounding Unulfo, who has come to guide him to safety. Unulfo has Bertarido change his clothes and then leads him to the palace garden before going back to find his family. Meanwhile Rodelinda and Eduige come across Bertarido's bloodstained clothes and fear the worst.
In the garden Grimoaldo agonizes over his feelings of jealousy, love, and remorse, finally falling into an exhausted sleep. He is discovered by Garibaldo, who steals his sword and is about to murder him when Bertarido intervenes and pursues and kills Garibaldo.
As Rodelinda and Flavio arrive, Bertarido returns and tosses the bloody sword at his enemy's feet, challenging the tyrant to kill him too. Grimoaldo, owing his life to Bertarido, hails him as king of Milan and declares that he will marry Eduige and rule in Pavia. All rejoice.