Ernest Dummkopf's theatrical company, who are to open in Troilus and Cressida that night, are ready to celebrate the wedding of the troupe's leading comedian Ludwig to Lisa, a soubrette of the company. However, the marriage cannot take place yet as there are no parsons available in the city, as all clerics have been summoned to the palace by the Grand Duke to discuss his own forthcoming marriage. This is one more cause for resenting the Grand Duke, and in fact all of the company are members of a plot to blow him up and place a new man on the throne. The secret sign by which members of the conspiracy recognise each other is to eat a sausage roll — a food of which they are by now all heartily sick.
It is clear that Ernest will win the election which is to follow the coup and become Duke, which troubles Julia Jellicoe, the English comedienne. As leading lady of the company, she is bound by contract to play the leading female role in any production. If Ernest, the manager, becomes the Grand Duke, she will have to be the Grand Duchess. This is a repugnant prospect to her (though a delightful one to Ernest), but she declares that she will play the part in a professional manner.
Meanwhile, Ludwig has met a man who returned his secret salute by eating three sausage rolls. Ludwig took him as a member of the conspiracy and told him all the details: only then did he realise that he had just revealed the entire plot to the Grand Duke's private detective. The company are aghast, believing they are doomed once the Grand Duke learns of the plot. The notary, Dr. Tannhäuser, offers a solution. He explains that a century ago the Grand Duke of the time, concerned about the loss of life in duelling, had created the “statutory duel ”: the duellers draw cards, and the one who draws the lower card loses. He becomes legally dead, and the winner takes over his position: his property, responsibilities and debts. The law regulating statutory duels, like all laws of Pfennig-Halbpfennig, lasts for one hundred years unless revived, and it is to lapse tomorrow.
Tannhäuser counsels Ernest and Ludwig to fight a statutory duel; immediately: the loser will be legally dead, and the survivor can go to the Duke and confess the whole plot. As informer he will be spared, while the other party will be "dead” and so beyond retribution. The next day, the loser will come to life when the law lapses, but since death expunges crime, his character will be unstained. Ernest and Ludwig promptly "fight" a statutory duel. Ernest draws a king, but Ludwig draws an Ace and wins.
Grand Duke Rudolph appears, heralded by his corps of chamberlains, and he instructs them in the arrangements for his wedding the next day to the miserly Baroness von Krakenfeldt, who is disconcerted that Rudolph insists on courting her here, in the market square, but he explains that he has made a law compelling couples to do any courting here in the square, so as to increase the value of his properties around the square. She is also upset by a newspaper article which says that Rudolph was betrothed in infancy to the Princess of Monte Carlo, but he explains that it's "practically off." The betrothal lapses when the Princess reaches the age of twenty-one, which will also happen tomorrow; but her father, the Prince, dares not venture out of his house for fear of being arrested by his creditors.
Rudolph finds out about the plot and fears the plot will be successful. Ludwig enters, intent on denouncing the plot to him. Before he can do so, Rudolph declares that he would give anything to avoid being blown up the next day, and Ludwig sees a way out. He patriotically volunteers to challenge Rudolph to a statutory duel. The two men will hide cards up their sleeves, guaranteeing victory to Ludwig. When the plot unfolds, Ludwig will be its victim. The next day, when the Act authorizing statutory duels expires, Rudolph can come back to life unharmed. Although Rudolph is sceptical, he accepts Ludwig's proposal. They stage a mock quarrel and conduct the rigged statutory duel as planned: Rudolph's King is beaten by Ludwig's Ace. Rudolph's subjects berate him with scorn, and he leaves, threatening revenge. Ludwig, now the Grand Duke, promptly extends the Act for another hundred years, thus ensuring that neither Rudolph nor Ernest can come back to life.
Suddenly Julia Jellicoe appears, and once again asserts that, as leading lady, she must take the leading role of the Grand Duchess. Lisa leaves in tears. Julia points out that if they are to occupy a Ducal court, they need to be dressed more impressively than their everyday clothes will allow. Ludwig recalls that they have a complete set of brand-new costumes for Troilus and Cressida, which they can use.
In a room in the Duke's palace, the new court parade in classical costume. Left alone, Ludwig and Julia fail to agree on how her role is to be played. Baroness von Krakenfeldt arrives for her wedding, and is startled at finding Rudolph has been replaced by Ludwig. But once she discovers that Ludwig has beaten Rudolph in a statutory duel, she points out that he must take on Rudolph's responsibilities — including his betrothal to her. So despite being already married to Julia, Ludwig goes off with the Baroness to get married.
Ernest, though legally dead, is desperate for news, and ventures in to try and find out what is going on. He sees the wedding procession in the distance, and assumes that Ludwig is marrying Lisa; but it cannot be so, for Lisa appears. She will not stop, but runs from him as from a ghost. He then supposes that Ludwig must be marrying his Julia — but she too appears. Though affecting to be also frightened of the "ghost", she stays and tells him what Ludwig has done.
The Prince of Monte Carlo arrives with his daughter the Princess and a retinue of supernumeraries — out-of-work actors hired from the Theatre Monaco to play the part of nobles. He has reversed his fortunes by inventing a game called roulette. The Princess is shocked when she discovers that Ludwig already has three Grand Duchesses. He tells her that he defeated Rudolph in a statutory duel, and assumed all of the former Grand Duke's responsibilities. She points out that her claim predates the Baroness von Krakenfeldt's, and Ludwig is therefore obliged to marry her.
The Notary reveals that the Act regulating statutory duels specifically lays down that the ace shall count as lowest, so Ludwig did not win, was never Grand Duke, and cannot have revived the act. Within seconds, the Act expires, returning Ludwig to the living. All dance off to get married — Rudolph and the Princess; Ernest and Julia; the Baroness and the Prince of Monte Carlo; and Ludwig and Lisa.