Rod Serling, already famed as the creator of The Twilight Zone series, wrote an adaptation of the novel The Authentic Death of Hendry Jones by Charles Neider (1956) - which was itself simply a novelization of the career of Billy the Kid relocated to Monterey, CA - at the request of producer Frank Rosenberg. The treatment was rejected and Rosenberg next hired Sam Peckinpah, who finished his first script on 11 November 1957. Marlon Brando's Pennebaker Productions had paid $40,000 for the rights to Authentic Death and then signed a contract with Stanley Kubrick to direct for Paramount Pictures. Peckinpah handed in a revised screenplay on 6 May 1959, and all was set.
It didn't stay all set. First, Kubrick didn't like the screenplay. Brando fired Peckinpah and hired Calder Willingham, but he and Brando stalled, so both Willingham and Kubrick were canned. Guy Trosper became the new screenwriter, who worked on the story with Brando, who hired himself as director.The movie as it runs today has very little resemblance to the Neider novel, and what remains has much more resonance with history than fiction.