Ed Sheeran wrote his song for The Hobbit from the "perspective of being a dwarf".

The singer-songwriter panned the track I See Fire for sequel The Desolation of Smaug, which is out this month.

Ed was instructed by director Peter Jackson to focus on a particular part of the movie when writing the song and the musician also tried to get into the right mindset.

"I"ve never been a dwarf, but I"ve wrote a song from the perspective of being a dwarf," he told MTV News.

"Peter said, "Focus on the last ten minutes. That"s what the song needs to reflect." He said, "Write a song that takes the audience by the hand and leads them from Middle Earth back into reality." So, yeah, I tried to do that."

Lyrics in the heartfelt piece include the lines "If this is to end in fire/ Then we shall all burn together/ Watch the flames climb high/ Into the night/ Calling out "father"/ Stand by and we will/ Watch the flames burn auburn on the mountain side".

Ed was treated to a special preview of the finished feature before the world premiere. When he attended the star-studded screening, the 22-year-old admits he became so engrossed in the movie, his own song came as a surprise to him.

"I actually forgot my song was in the film," he sheepishly admitted. "I"m such a Tolkien and Peter Jackson fan, I was watching the film just assuming that was the premiere to watch the film. I was watching it and then the song came on and I was like, "Oh, yep. That"s why I"m here. Cool." But I was enjoying it that much, I forgot. "