In eighteenth-century Hungary, the emperor Napoleon sends his inspector general throughout the country to uncover corruption and report back to him. In Brodny, Yakov, a traveling medicine salesman, and his assistant, Georgi, are demonstrating Yakov's special concoction, Golden Elixer. When an old lady spends her last pennies on a bottle, hoping to cure her dying husband, Georgi experiences a sudden fit of honesty and, after telling her that the elixer is worthless, is forced to run away from the angry crowd. Furious, Yakov orders Georgi away. Georgi fixes a hole in his boot with a piece of paper signed by Napoleon and then wanders into Brodny, where he is arrested as a horse thief. Soon, however, having heard that the inspector general is nearby, the council decides that Georgi is really the inspector general in disguise. They release him from jail, and when they find the bit of paper with Napoleon's signature, they are convinced that their suspicions are accurate. The mayor invites Georgi into his home, and together with the other councilors, plans a number of distractions to interfere with the investigations. The next morning, Georgi is about to tell the townspeople they have made a mistake, when Yakov, who is in the crowd, recognizes him and pretends to be his servant. Georgi is still determined to escape before his deception is discovered, until Leza, a servant girl, tells him that the people of Brodny are hoping he will stay and expose rampant government corruption and misery. That evening, various officials, one after another, visit Georgi's room to offer evidence of wrongdoings in exchange for mercy. Yakov takes advantage of this opportunity to demand money in exchange for silence. He tells Georgi that they will use the money to replace funds stolen by the council, which were to have been used to buy a church organ. Later, Leza overhears the council plotting to kill Georgi. She hands him a written warning, but Georgi, who is illiterate, asks Yakov to read it to him. Yakov claims it is a love letter, intending to send Georgi to his death. At midnight, Georgi hurries to the barn, thinking that he has a rendezvous with Leza. There, learning of Yakov's betrayal, he prevents Yakov from leaving with the funds he has collected. Georgi and Leza then take the money to buy an organ. While they are gone, the real inspector general arrives in Brodny, and when Georgi returns, he and Yakov are jailed. Impressed by Georgi's actions, however, the inspector general announces that Georgi is the first honest man he has met and names him the new mayor. Leza then joins Georgi as he greets the villagers.