Stockholm, Sweden. Courtiers await an audience with King Gustavo III, including a group of conspirators led by Counts Horn and Ribbing. The king enters. He notices the name of Amelia, the wife of his secretary and friend, Count Anckarström, on the guestlist for a masked ball, and thinks about his secret love for her. Left alone with Gustavo, Anckarström warns the king of a conspiracy against him, but Gustavo ignores the threat. The young page Oscar tells the king about the fortuneteller Madame Ulrica Arvidsson, who has been accused of witchcraft and is to be banished. Deciding to see for himself, the King arranges for his court to pay her an incognito visit.
In a building by the port, Madame Arvidsson invokes prophetic spirits and tells the sailor Cristiano that he will soon become wealthy and receive a promotion. The king, who has arrived in disguise, slips money and papers into Cristiano’s pockets. When the sailor discovers his good fortune, everybody praises Madame Arvidsson’s abilities. Gustavo hides as she sends her visitors away to admit Amelia, who is tormented by her love for the king and asks for help. Madame Arvidsson tells her that she must gather a magic herb after dark. When Amelia leaves, Gustavo decides to follow her that night. Oscar and members of the court enter and the king ask Madame Arvidsson to read his palm. She tells him that he will die by the hand of a friend. Gustavo laughs at the prophecy and demands to know the name of the assassin. Madame Arvidsson replies that it will be the first person that shakes his hand. When Anckarström rushes in Gustavo clasps his hand saying that the oracle has been disproved since Anckarström is his most loyal friend. Recognizing their king, the crowd cheers him as the conspirators grumble their discontent.
That night in an abandoned warehouse, Amelia, who has followed Madame Arvidsson’s advice to find the herb, expresses her hope that she will be freed of her love for the king. When Gustavo appears, she asks him to leave, but ultimately they admit their love for each other. Amelia hides her face when Anckarström suddenly appears, warning the king that assassins are nearby. Gustavo makes Anckarström promise to escort the woman back to the city without lifting her veil, then escapes. Finding Anckarström instead of their intended victim, the conspirators make ironic remarks about his veiled companion. When Amelia realizes that her husband will fight rather than break his promise to Gustavo, she drops her veil to save him. The conspirators are amused and make fun of Anckarström for his embarrassing situation. Anckarström, shocked by the king’s betrayal and his wife’s seeming infidelity, asks Horn and Ribbing to come to his house the next morning.
In his apartment, Anckarström threatens to kill Amelia. She asks to see their young son before she dies. After she has left, Anckarström declares that is it the king he should seek vengeance on, not Amelia. Horn and Ribbing arrive, and Anckarström tells them that he will join the conspirators. The men decide to draw lots to determine who will kill the king, and Anckarström forces his wife to choose from the slips of paper. When his own name comes up he is overjoyed. Oscar enters, bringing an invitation to the masked ball. As the assassins welcome this chance to execute their plan, Amelia decides to warn the king.
Gustavo, alone in his study, resolves to renounce his love and to send Amelia and Anckarström to Finland. Oscar brings an anonymous letter warning him of the murder plot, but the king refuses to be intimidated and leaves for the masquerade. In the ballroom, Anckarström tries to learn from Oscar what costume the king is wearing. The page answers evasively but finally reveals Gustavo’s disguise. Amelia and the king meet, and she repeats her warning. Refusing to leave, he declares his love one more time and tells her that he is sending her away with her husband. As the lovers say goodbye, Anckarström stabs the king. The dying Gustavo forgives his murderer and admits that he loved Amelia but assures Anckarström that his wife is innocent. The crowd praises the king’s goodness and generosity.