The song was commissioned for the soundtrack of the 2013 film The Hobbit: The Desolation of Smaug, in which it played over the closing credits. Chosen by The Hobbit director Peter Jackson, Sheeran saw the film, wrote the song, and recorded most of the track elements on the same day.