The poet Prosdocimo is searching for a plot for a drama buffo. He meets a band of Gypsies, including the beautiful but unhappy Zaida and her confidant Albazar. Perhaps the Gypsies can provide some ideas. Prosdocimo's friend, the obstinate and sometimes foolish Geronio, is looking for a fortune teller to advise him on his marital problems, but the Gypsies tease him. Zaida tells Prosdocimo that she is from a Turkish harem. She and her master, Prince Selim, were in love, but jealous rivals accused her of infidelity and she had to flee for her life, accompanied by Albazar. Nevertheless, she still loves only one man and that man is Selim. Prosdocimo knows that a Turkish prince will shortly be arriving in Italy. Perhaps he can help? Geronio's capricious young wife Fiorilla enters singing (in contrast to Zaida) of the joys of free and unfettered love. A Turkish ship arrives and the prince disembarks. It is Selim himself. Fiorilla is immediately attracted to the handsome Turk, and a romance rapidly develops. Narciso appears in her pursuit. He is an ineffectual admirer of Fiorilla posing as a friend of her husband. Geronio follows, horrified to learn that Fiorilla is taking the Turk home to drink his coffee!
Fiorilla and Selim are flirting. Geronio enters timidly and Selim is initially impressed by his unexpected meekness, however Narciso noisily scolds Geronio. The domestic menage irritates Selim and he leaves after quietly arranging to meet Fiorilla again by his ship. Geronio tells Fiorilla he will not allow any more Turks - or Italians - in his house. She sweetly undermines his complaints, and then, when he softens, threatens to punish him by enjoying herself even more wildly.
The sea shore at night. Selim is waiting for Fiorilla. Instead he meets Zaida. The former lovers are shocked and delighted, and declare once more their mutual love. Narciso re-appears, followed by Fiorilla in disguise, with Geronio in pursuit. Selim confuses the veiled Fiorilla with Zaida and the two women come suddenly face to face. Fiorilla accuses Selim of betrayal. Zaida confronts Fiorilla. Geronio tells his wife to go home.
At an inn, Selim approaches Geronio amicably, offering to buy Fiorilla. That way Geronio can be rid of his problems and also make some money. Geronio refuses. Selim vows to steal her instead. After they leave, Fiorilla and a group of her friends appear, followed by Zaida. Fiorilla has set up a meeting between them and Selim, so that the Turk will be forced to decide between the two women. In the event he is indecisive, not wishing to lose either of them. Zaida leaves in disgust. Selim and Fiorilla quarrel but are eventually reconciled. As the poet tells Geronio, there is going to be a party. Fiorilla will be there to meet Selim, who will be masked. Geronio should also go - disguised as a Turk. Narciso overhears this, and decides to take advantage of the situation to take Fiorilla himself, in revenge for her former indifference. Geronio laments his destiny, that he should have such a terrible, crazy wife. Albazar passes by holding a costume - for Zaida.
A ballroom with masqueraders and dancers; Fiorilla mistakes Narciso for Selim and Narciso leads her away. Meanwhile, Selim enters with Zaida, under the impression that she is Fiorilla. Geronio is in utter despair at finding two couples and two Fiorillas! Narciso and Selim both entreat their partners to leave with them. Confused and angry, Geronio attempts to stop both couples, but they eventually escape.
Back at the inn, Prosdocimo meets Geronio. They now know that Selim was with Zaida and guess that Fiorilla was with Narciso. Albazar confirms that Selim will definitely stay with Zaida. Prosdocimo advises Geronio to have his revenge on Fiorilla by pretending to divorce her and threatening to send her back to her family.
Having discovered Narciso's deception, Fiorilla tries to find Selim, but he has already left with Zaida. She returns home only to find the divorce letter, and her belongings being removed from the house. She is devastated by shame, and promptly deserted by her friends.
At the beach, Selim and Zaida are about to set sail for Turkey, while Fiorilla is looking for a boat to take her back to her home town. Geronio finds and forgives her. They are affectionately reconciled. Both couples are now reunited and Prosdocimo is delighted with his happy ending.