Act 1
Market day in (a mythical) Lahore. The two market vendors Maïma and Balkis tout their wares. Bababeck, the corrupt cupbearer of the incumbent governor, flirts with the young women. He is a widower and already a bit older, but imagines himself to be attractive and yearns for the day when, having married off his unattractive daughter Périzade, he will be able to devote himself entirely to a life as a bachelor. From nearby, the sound of an uprising fills the air. Bababeck, suspecting the worse, hurries to his house across from the palace. Balkis is concerned about her beloved, Xaïloum, who never misses out on a provocation, and whom she presumes to be among the insurgents. Maïma also expresses her worries, and tells Balkis about the sad loss of her beloved, Saëb, and of her faithful dog, Barkouf, who were both abducted some time ago by army recruiters. Meanwhile, yet another governor has been thrown out of the window. In this way, the exploited and tormented population obtains some regular breathing space, but with the result that the successor appointed by the Great Mogul usually rules the province in an even more draconian manner than his predecessor. Among the insurgents is, as presumed, Xaïloum, who took out his anger by demolishing Bababeck's residence and therefore, upon the Great Mogul's arrival in the rebellious city, has to hide from the militia.
Instead of appointing Bababeck to be the new governor, as Bababeck had hoped and expected, the Great Mogul decides to lay down the law and spontaneously makes his dog the new head of the Lahore's government. Bababeck is promoted to the rank of vizier, and is charged with promptly implementing the laws and decrees of the dog governor, otherwise he, Bababeck, can expect to be severely punished. Maïma almost swoons when she not only recognizes the missing Saëb as a soldier in the Great Mogul's guards, but also her Barkouf as the Great Mogul's now enthroned governor!
Act 2
Bababeck worries that his future son-in-law – the unfortunate Saëb, as quickly becomes apparent – will refuse the hand of his daughter as soon as he sees her, and therefore orders Périzade to receive Saëb only with a veil covering her face. Périzade, who is no longer a spring chicken, wants to know from her father how, after years of searching and rejections, he now has found a suitor who will marry her. The explanation is simple: Bababeck has evidence that Saëb's father planned an attack on the previous governor, and is blackmailing him with it. The marriage between Saëb and Périzade is the price for Bababeck's pledge of secrecy. In order to save his father, Saëb has accepted his fate without knowing his future wife. Now, for the consummation of the marriage, only the written and verbal approval of the new governor is necessary. However, Bababeck's servant Kaliboul, who was sent to Barkouf to have the marriage contract ratified, becomes terrified by the fear of being mauled to death by Barkouf and returns white as a sheet and empty-handed. The postponement is a disappointment for Périzade and Bababeck, and a huge relief for Saëb, who after years of separation can only think of one thing: his lost Maïma.
Maïma comes to the palace and demands to be brought before the new governor. Bababeck recognizes the lovely young girl from the market and does not turn her away. Maïma is able to allay his concern that Barkouf will immediately tear her to pieces, for years earlier they were the best of friends, and he literally ate out of her hand. Bababeck seizes the opportunity and reveals his brilliant plan to Maïma. He will officially make her Barkouf's chamber secretary and exclusive translator, since she is the only one whom Barkouf allows to come near him and can understand his barking. Bababeck's own decisions, proclaimed by Maïma, can in this manner be sold to the populace as decrees by Governor Barkouf, without anybody seeing through the deception. Maïma immediately understands the intrigue and consents to the proposal of a secret co-regency with Bababeck.
She immediately goes to Barkouf's chambers. To Bababeck's satisfaction, and to the astonishment of the court, the dog becomes delirious with joy at the sight of her and instead of attacking her, indulges in demonstrations of love toward his former mistress. As proof of his devotion, Maïma brings back the marriage document "signed" by Barkouf, not realizing that she has made herself instigator of Saëb's marriage to Périzade. Bababeck triumphs and opens the general audience. A delegation of citizens from Lahore presents a petition in which a reduction of the tax burden is urged since the populace is being crushed by the tributes. Maïma goes to Barkouf and then "translates" his barked answer – however not, as Bababeck whispers into her ear, as a rejection of the request, but rather as assent. The seething Bababeck still thinks it could be a misunderstanding, but he is proven wrong by the next petition – it is a plea for clemency for Xaïloum, who has been sentenced to death. For Maïma again "translates" Barkouf's woof as the opposite of Bababeck's decree, namely Xaïloum's pardon. While the people cheer the wise and lenient ruler, Bababeck slowly realizes that he has become the victim of his own intrigue. He plots revenge.
Maïma's elation turns to gloom when she sees Saëb at Périzade's hand with the marriage witnesses on the way to the governor, for the governor's verbal permission for the marriage of the vizier's daughter is still pending. Maïma does not know about the agreement between the fathers and has to assume that Saëb has broken the vow of fidelity made to her years earlier. Bababeck cannot prevent Maïma from "translating" a third time against his interests. Barkouf revokes the previously granted consent for Saëb and Périzade's wedding – his fierce barking allows no doubt, and Maïma translates it accordingly.
Act 3
There remains only one way to put a stop to Maïma's uncontrolled actions: the governor 'himself' must be done away with. A group of conspirators around Bababeck and the meanwhile out-of-work court flunkeys make plans to poison Barkouf. Simultaneously, contact is established with the Tatars who are encamped before the city, which has become easy prey after the Great Mogul's withdrawal of the military to take part in a foray in another province. The freed Xaïloum becomes a witness to the conspiracy, having slipped into the seraglio to see his beloved Balkis, who moved into the palace with Maïma. However, having understood only every other word, he can give Maïma only a very inexact report. Maïma, who has meanwhile been able to speak with Saëb and now knows the reasons for his forced marriage, is forewarned. She sets a trap for the conspirators. During the evening banquet, poison is put into Barkouf's wine. However Maïma, in the name of the governor, calls upon the conspirators to drink to his health from the same wine, by which means the coup is revealed. At this very moment, the Tatars charge into the city. The people take up arms and, led by Barkouf and Saëb, charge off to confront the enemy. The Great Mogul, returning from his foray, can only legitimize the new circumstances: the marriage of the wise Maïma with the brave Saëb. However, Barkouf has been killed in battle, and therefore Saëb is promoted in his place. The new governor is hailed by the people.