Ed Sheeran is living the dream. The award-winning singer has penned a track, "I See Fire," for the soundtrack for Peter Jackson's "The Hobbit: The Desolation of Smaug."

The ginger-haired singer/songwriter, who is a big fan of "The Hobbit," shared on Twitter that his new dark, folky track will play during the end credits of the December 13 movie release. "I got the chance to produce and play all the instruments on it apart from the cello. Managed to learn violin for a day, hope you all dig it," he shared, also noting that the track won't appear on his follow-up to 2012's +.

"It's also the first solo song I've released in over 2 years, it's not on the new album though, that fun starts next year," Sheeran wrote.

The soundtrack will hit retailers on December 10 and will also feature music by Academy Award winner Howard Shore, who also worked on the "Lord of the Rings" trilogy and "The Hobbit: An Unexpected Journey." In addition to the standard edition, a special edition soundtrack will also be available, featuring 12 extended tracks, a bonus track, expanded liner notes and interactive sheet music.

In a statement, Sheeran added, "It was such an honor working with Peter Jackson on this song. Not only is he one of my favorite directors of my favorite films, 'The Hobbit' was the first book I ever read as a child, so it means a lot that I get to produce music for the motion picture.

"I was allowed complete freedom to create what I thought was fitting for the film, which is very rare, and Peter, [filmmakers] Fran [Walsh] and Philippa [Boyens] were always on hand to give notes and pointers. The entire team down in New Zealand was out of this world," he continued. "The film is amazing! I'm still geeking out that I've done a song for a Peter Jackson film set in Middle-earth!"

Jackson co-signs Sheeran's love for the franchise. "Ed Sheeran is a true Tolkien fan and also happens to be a brilliant singer/songwriter," he said. " 'I See Fire' is Ed's emotional response to the film. It's perfect."

The 22-year-old has never been shy about his fandom for Jackson and Middle-earth. In fact, back in March, he opened up about almost stabbing pal Taylor Swift with a sword the director gifted him.

"It's like a real sword," Sheeran told MTV News earlier this year. "I got it shipped over, shipped over to Omaha, so I was bringing it back to Nashville and I think [Taylor] and her crew were weirded out by it anyway. They were just like, 'Why does Ed have a sword?' " He continued, "The plane is kind of taking off and [the sword] started sliding down [the table] and I was like, 'No!' It was just about to impale Taylor."