The opening sequence involves a flaming factory, a missing foreman, and an accused worker. Leopold Dilg (Cary Grant), a factory worker and a self-professed radical and political anarchist is falsely accused (framed on trumped-up charges of arson and murder) in a small New England town by the factory owner Andrew Holmes (Charles Dingle), for setting fire to the Holmes Woolen Mill factory and killing its guard/foreman Clyde Bracken (Tom Tyler). After being arrested, tried, and sentenced to hang, Dilg escapes from prison, goes on the run from the police, and hides out in the secluded country home of high-schoolteacher Nora Shelley (Jean Arthur). She is in the midst of preparing the old farmhouse (Sweetbrook cottage) in which she used to live for summer rental, as the fugitive with a badly injured ankle arrives. They had known each other as schoolmates:Nora: Leopold, as far as I know, you're capable of anything, even burning a factory. You were the wildest kid that ever went to a Locester school. Dilg: You wore pigtails then. I was in love with you.
Amusing circumstances arise as she attempts to keep his presence a secret in the attic from the unsuspecting renter who arrives unexpectedly 24 hours early, due to the fault of his secretary. The tenant is a conservative, strict law-and-order, Dean of Commonwealth Law School and legal scholar, Professor Michael Lightcap (Ronald Colman), who is being considered for a Supreme Court appointment. The erudite professor hears Dilg snoring at night, and thinking it's Nora, remarks: "She must have adenoids." Nora is forced to identify Dilg as "Joseph," the gardener to the professor. In a classic scene, she drops the professor's egg breakfast on the newspaper's front page, where Dilg's picture is portrayed with the headline: "DILG ESCAPES TRAP!"
Dilg and Lightcap become engaged in long arguments about the law. Dilg maintains that the law is "a gun pointed at someone's head" rather than being created with common sense for what people actually do. Although they disagree at first, Dilg is persuasive. The professor learns Dilg's real identity, but must be careful not to hurt his chances for appointment when he defends and reopens Dilg's case.
In the end, Lightcap helps clear Dilg of his crime, defends his rights, and uncovers a frame-up, with a stirring speech in front of the courtroom to an unruly mob:His (Dilg's) only crime was that he had courage and spoke his mind...This is your law and your finest possession. It makes you free men in a free country. Why have you come here to destroy it? If you know what's good for you, take those weapons home and burn them - and then think. Think of this country and of the law that makes it what it is. Think of a world crying for this very law. Then maybe you'll understand why you ought to guard it, and why the law has got to be the personal concern of every citizen, to uphold it for your neighbor as well as for yourself. Violence against it is one mistake. Another mistake is for any man to look upon the law as just a set of principles. Just so much language printed on fine, heavy paper. Something he recites and then leans back and takes it for granted that justice is automatically being done. Both kinds of men are equally wrong. The law must be engraved in our hearts and practiced every minute, to the letter and spirit. It can't even exist unless we're willing to go down into the dust and blood and fight a battle every day of our lives to preserve it, for our neighbor as well as ourselves.
The studio originally shot two different conclusions to the film -- one where Cary Grant gets the girl, and one where Ronald Colman wins Jean Arthur's affections. The film ends with both Dilg and Nora in Washington, to see Lightcap take his rightful place on the judicial bench. Although Nora winks at the judge, she races after Dilg for a film-ending embrace in the hallway of the US Supreme Court building.