Leone commissioned Bernardo Bertolucci and Dario Argento film critics, who later became directors to help him develop the film in late 1966. The men spent much of the following year watching and discussing numerous classic Westerns such as High Noon, The Iron Horse, The Comancheros, and The Searchers at Leone's house, and constructed a story made up almost entirely of "references" to American Westerns.
For Once Upon a Time in the West, Leone changed his approach over his earlier westerns. Whereas the "Dollars" films were quirky and up-tempo, a celebratory yet tongue-in-cheek parody of the icons of the wild west, Once upon a Time in the West is much slower in pace and sombre in theme.
The music was written by composer Ennio Morricone, Leone's regular collaborator, who wrote the score under Leone's direction before filming began. As in The Good, the Bad and the Ugly, the haunting music contributes to the film's grandeur and, like the music for The Good the Bad and the Ugly, is considered one of Morricone's greatest compositions.
The film features leitmotifs that relate to each of the main characters (each with their own unique theme music) as well as to the spirit of the American West. It was Leone's desire to have the music available and played during filming. Leone had Morricone compose the score before shooting started and would play the music in the background for the actors on set.