Act 1
King Xerxes is admiring his beloved plane tree when he is struck by Romilda’s song. She is the daughter of Ariodate, the commander of his army. The King asks his brother, Arsamene, to tell Romilda about his love for her, but he refuses to do so as Arsamene and Romilda are already in love with each other. Undeterred, Xerxes decides to woo Romilda and Arsamene warns her about the King’s intentions. Unfortunately for them, Atalanta, Romilda's sister, is also in love with Arsamene and encourages the King in his determination. Romilda opposes the advances of her new admirer. In retaliation, Xerxes decides to banish his brother.
Amastre, a foreign princess who was promised to marry Xerxes, has disguised herself as a soldier in his army. She watches him as he receives Ariodate returning victorious from a campaign. Xerxes announces that he will reward the commander by having Romilda marry a man equal in rank to the King himself. Amastre decides not to reveal who it is and swears revenge. Arsamene has his servant Elviro deliver a letter to Romilda, telling her how distressed he is at their forced separation and pledging to try to visit her in secret. Atalanta, hoping to secure Arsamene for herself, tells Romilda that Arsamene is in love with another girl, but Romilda does not believe it.
Act 2
Disguised as a flower seller in order to deliver his master’s message, Elviro makes clear his disapproval of the King’s desire to marry Romilda, a mere subject. Princess Amastre, in her disguise as a man, hears Elviro expressing this and she is aghast at the King's plan to marry another when he promised to be hers. Elviro hands the letter to Atalanta, who promises to give it to Romilda. Instead, she shows it to the King, telling him that Arsamene sent it to her and no longer loves Romilda. Xerxes takes the letter and shows it to Romilda, telling her Arsamene is now in love with Atalanta, not her. Shaken at the news, Romilda nevertheless continues to reject the King's attempts at seduction. Amastre tries to commit suicide, but is stopped just in time by Elviro. The servant tells her what Atalanta told him; that is, that Romilda would now yield to the King.
Sailors hail the completion of a bridge spanning the Hellespont, constructed under Xerxes’s orders, and he orders Ariodate to cross the bridge with his army and invade Europe. The King finds his heart-broken brother and tells him to cheer up as he is free to marry Atalanta, but Arsamene insists that the woman he loves is Romilda. Hearing this, Xerxes advises Atalanta to forget about Arsamene, but she says that is impossible. Elviro witnesses a violent storm threaten to collapse the new bridge, and he calms his nerves with drink.
Xerxes again implores Romilda to marry him but she remains firm in her refusal. Amastre intervenes and draws her sword on the King. She manages to escape arrest only thanks to Romilda, who convinces the guard to release her. Amastre says Romilda should not be forced to marry a man she does not love, and Romilda praises those who are true to their hearts.
Act 3
Romilda and Arsamene discover that Atalanta has plotted behind their backs to separate them. Xerxes begins to threaten Romilda, who, frightened, agrees to marry him if her father gives his consent. Arsamene bitterly reproaches her for this. When the King finds Ariodate, he once more asks him if he is happy for his daughter to marry someone equal in rank to the King. The commander thinks this means Arsamene and happily gives his consent. When Xerxes returnes to Romilda, she tells him that Arsamene loves her and in fact has already kissed her. Furious, the King orders his brother to be put to death. Amastre asks Romilda to take a letter to the King, telling her that it will help her cause, and the jilted princess bewails her plight. Romilda tries to warn Arsamene of the danger he is facing, but he blames her for his sentence.
At the temple of the sun, Ariodate waits for the bride and groom. When Romilda and Arsamene arrive, he hastens them so that the wedding can be celebrated immediately. Xerxes enters, ready to marry Romilda, and is enraged when he discovers that it is too late, as Ariodate has already married his daughter to Arsamene. The King denounces his commander and is even more enraged when the letter arrives from Amastre accusing him of infidelity. Xerxes orders Arsamene to kill Romilda, but Amastre comes forward and reveals her identity. Abashed, the King wishes his brother and Romilda happiness in their marriage and agrees to marry Amastre.