A mythical land between the sun and the moon. Three ladies in the service of the Queen of the Night save Prince Tamino from a serpent. When they leave to tell the queen, the birdcatcher Papageno appears ("I'm Papageno"). He boasts to Tamino that it was he who killed the creature. The ladies return to give Tamino a portrait of the queen's daughter, Pamina, who they say has been enslaved by the evil Sarastro. Tamino immediately falls in love with the girl's picture ("This portrait's beauty"). The queen, appearing in a burst of thunder, tells Tamino about the loss of her daughter and commands him to rescue her ("My fate is grief"). The ladies give a magic flute to Tamino and silver bells to Papageno to ensure their safety on the journey and appoint three spirits to guide them (Quintet: "Hm! hm! hm! hm!").
Sarastro's slave Monostatos pursues Pamina but is frightened away by Papageno. The birdcatcher tells Pamina that Tamino loves her and is on his way to save her. Led by the three spirits to the temple of Sarastro, Tamino learns from a high priest that it is the Queen, not Sarastro, who is evil. Hearing that Pamina is safe, Tamino charms the wild animals with his flute, then rushes off to follow the sound of Papageno's pipes. Monostatos and his men chase Papageno and Pamina but are left helpless when Papageno plays his magic bells. Sarastro enters in great ceremony. He punishes Monostatos and promises Pamina that he will eventually set her free. Pamina catches a glimpse of Tamino, who is led into the temple with Papageno.
Sarastro tells the priests that Tamino will undergo initiation rites ("O Isis and Osiris"). Monostatos tries to kiss the sleeping Pamina ("Men were born to be great lovers") but is surprised by the appearance of the Queen of the Night. The Queen gives her daughter a dagger and orders her to murder Sarastro ("Here in my heart, Hell's bitterness").
Sarastro finds the desperate Pamina and consoles her, explaining that he is not interested in vengeance ("Within our sacred temple"). Tamino and Papageno are told by a priest that they must remain silent and are not allowed to eat, a vow that Papageno immediately breaks when he takes a glass of water from a flirtatious old lady. When he asks her name, the old lady vanishes. The three spirits appear to guide Tamino through the rest of his journey and to tell Papageno to be quiet. Tamino remains silent even when Pamina appears. Misunderstanding his vow for coldness, she is heartbroken ("Now my heart is filled with sadness").
The priests inform Tamino that he has only two more trials to complete his initiation. Papageno, who has given up on entering the brotherhood, longs for a wife instead ("A cuddly wife or sweetheart"). He eventually settles for the old lady. When he promises to be faithful she turns into a beautiful young Papagena but immediately disappears.
Pamina and Tamino are reunited and face the ordeals of water and fire together, protected by the magic flute.
Papageno tries to hang himself on a tree but is saved by the three spirits, who remind him that if he uses his magic bells he will find true happiness. When he plays the bells, Papagena appears and the two start making family plans (Duet: "Pa-pa-pa-pageno!"). The Queen of the Night, her three ladies, and Monostatos attack the temple but are defeated and banished. Sarastro blesses Pamina and Tamino as all join in hailing the triumph of courage, virtue, and wisdom.