The music was written by Burt Bacharach, and was originally intended to be an instrumental. But later Hal David added the lyrics, and the song was published in 1967. According to Bacharach, the melody was inspired by watching Ursula Andress in an early cut of the film.
In 1969, American rock band Vanilla Fudge released an experimental version of the song, as the band was famous for innovative rock arrangements of contemporary hit songs of the time.
Isaac Hayes covered the song for his 1970 album ...To Be Continued. While Hayes used the same lyrics, his cover includes a unique instrumental which has been heavily sampled on R&B and hip-hop records. His version of the song was also featured in Dead Presidents.