Written by guitarist Keith Richards, the song is a response to his arrest for heroin possession in Toronto in February 1977. The criminal charges and prospect of a prison sentence loomed over the Some Girls recording sessions and in fact endangered the future of the Rolling Stones.
In the lyrics Richards reflects unapologetically on his lifestyle up to that point. The line "it's another goodbye to another good friend" in the first verse can be interpreted as referring to Gram Parsons, Richards' close friend who died in 1973 from a drug overdose, and/or to heroin itself: Richards had sought medical treatment for heroin addiction following his arrest in Toronto, and his resolution to overcome his addiction would be a significant factor in his upcoming trial.
Originally entitled "Rotten Roll", the song was recorded in a Paris studio in March 1978 during one of Mick Jagger's absences from the Some Girls sessions. The completed track - "a high-energy rock & roller" - features Richards on lead vocals, acoustic and electric guitars and bass; Ronnie Wood on pedal steel, slide guitar and backup vocals; Charlie Watts on drums and Jagger on backup vocals.
Richards first performed the song in concert on the The New Barbarians' tour of North America in 1979; it wasn't until 1989 that it entered the Rolling Stones' concert repertoire. Like "Happy", the song has become one of Richards' "signature tunes", performed on most Rolling Stones tours since 1989; he also played it on the X-Pensive Winos' 1992-93 tours promoting his album Main Offender.