A.R. Rahman composed this song based on the verse "O Tere Ishq Nachaya Kar Ke Thhaiyan Thhaiyan" by the Sufi poet Bulleh Shah. Gulzar wrote in his lyrics later. Rahman has talked about using this technique of composing to Tamil poet, Subramanya Bharathi's, or Sufi poets' lyrics when he gets stuck while composing and needs an inspiration.
This song was used in the opening credits of the Hollywood film "Inside Man" (2006). The rights for the song were bought for Rs. 1 crore. The story behind this transaction started with the making of Mani Ratnam's "Alaipaayuthey" (2000). Mani Ratnam had wanted to use a Backstreet Boy song in the film but the music label had quoted a steep price of Rs. 1 crore. A miffed Mani Ratnam had backed out and had a new piece composed for the scene instead. Many years later, when he was approached for the rights of "Chaiyya Chaiyya" for "Inside Man", Mani Ratnam quoted the same price of Rs. 1 crore and got it.[MR17]
It was during the shooting of this song that cinematographer Santosh Sivan approached Shah Rukh Khan about working in his upcoming film "Asoka" (2001).[1][2]