Ed Sheeran was drunk when he was offered the chance to record a track for the new 'Hobbit' film.

The 22-year-old singer wrote the song 'I See Fire' for 'The Hobbit: The Desolation of Smaug' but almost missed out on the chance to work on the film after receiving an email from the movie's director, Peter Jackson.

Ed told the Daily Star newspaper: ''I was off my face drunk.

''There was a lot of champagne and champagne gets me drunk quite quickly. I looked at my email. It was like a dream. I didn't process it.

''So then I put my phone away and continued partying.

''The next day I read it again and said: 'Sh*t!' Then I told my manager and he said: 'Sh*t!'''

Peter first met Ed, who also wrote the track 'Drunk', when he took his daughter to one of the musician's shows.

Ed previously said: ''Then I was invited round for lunch the next day, we hung out, and it was fun.

''About six months later I got a call asking if I wanted to be involved in the end credit song.

''So I instantly got on a plane to New Zealand, met everyone that was involved in the film and watched the film. Then I wrote the song.''

Ed played all of the instruments on the track, including the violin, which he had never played before.

He explained: ''We got a violin player in, but he didn't get it right, so yeah, I thought I'd attempt to doing it myself.''