As the act begins, Yum-Yum's sisters and friends are helping her make ready for her wedding. She concludes that she is more lovely than any other woman because she is a child of nature and takes after her mother.
Yum-Yum and her sisters are very sad at the thought of the very brief marriage, and Nanki-Poo enters and tries to lift their spirits. The wedding plans are disrupted upon Ko- Ko's discovery that, under the Mikado's law, when a married man is beheaded, his wife must be buried alive. Yum-Yum's enthusiasm for the marriage is suddenly diminished.
To spare Yum-Yum this grim fate, Nanki-Poo decides to kill himself at once. This, however, would leave Ko-Ko with nobody to behead-just as word arrives that the Mikado is at this very minute approaching Titipu. Nanki-Poo offers himself for immediate decapitation, but Ko-Ko is not equal to the task. Ko-Ko realizes, though, that he can accomplish the same purpose by swearing a false affidavit that he has done the deed, provided that Nanki-Poo leaves at once and never comes back. Since Nanki-Poo will not leave otherwise, Ko-Ko sends Yum-Yum with him,and the happy couple goes off to be married just as the Mikado enters the town.
As the Mikado enters, he describes how he, in a fatherly kind of way, governs each tribe and sect. Then he describes how he wants to make the punishment meet the crime.
The Mikado is delighted to hear that an execution has taken place, and is eager to hear the details. Ko-Ko, assisted by Pitti-Sing and Pooh-Bah, recounts a highly creative description of the execution.
The Mikado's visit, however, concerns another matter: at Katisha's prompting, he is seeking the whereabouts of his son. Unfortunately, this turns out to be Nanki-Poo, the man Ko-Ko has just testified he beheaded. Ko-Ko and his accomplices are declared guilty of "compassing the death of the Heir Apparent" and scheduled to die after luncheon - "something humorous, but lingering, with either boiling oil or melted lead."
The Mikado declares that he is sorry for them, but it is an unjust world, and virtue is triumphant only in theatrical performances. Their only hope is to admit the falsehood of the affidavit and of their testimony, and produce Nanki-Poo alive and well. Nanki-Poo, however, having already married Yum-Yum, is no longer free to marry Katisha and thus cannot reveal himself without risking both his own life and his wife's. Ko-Ko is left with no other choice but to woo, win, and wed Katisha herself.
Katisha is very upset over the loss of Nanki-Poo [Alone, and yet alive!] Katisha at first refuses Ko-Ko, but he then sings her a touching ballad , and she accepts him.
Nanki-Poo then returns to life and presents himself, and his new bride, to his father. Ko-Ko devises an explanation of his subterfuge that satisfies the Mikado, who commutes his death sentence to one of life with Katisha. All ends with laughing song and merry dance.