On his way home, Mikołaj Twardowski is attacked by bandits. He calls on the devil for help, who rescues him from danger. The devil's intentions are not selfless. Twardowski signs a pact with Hell, unaware of what he is agreeing to. Eighteen years pass, and the devil appears at Mikołaj's house with the intention of taking his son away. The cautious Twardowski, just before his death, sends his son to a hermit, who advises him on how to steal the contract his father signed.