Friedrich Dürrenmatt wrote the screenplay (together with Hans Jacoby and Ladislao Vajda) while at the same time developing the novel form of the story under the title "Das Versprechen" (The Pledge). He finished the novel after the film was completed and gave it a different, much darker ending.