One by one, the cast of “The Hobbit” trilogy are leaving New Zealand. Ian McKellen and Orlando Bloom have said goodbye to their iconic roles as Gandalf and Legolas as they finished filming their parts, but not before Bloom left an awesome remix of “They are Taking the Hobbits to Isengard.”

Director Peter Jackson shared a YouTube video of the 36-year-old English actor singing along to the 2006 viral hit, in which Legolas’ famous line has been repeated many times over.

“A day after saying goodbye to Gandalf and Tauriel, it was time to farewell Legolas. What a great day it was, with Orlando battling a serious Orc for all 12 hours of shooting – part of the Battle of the 5 Armies for the third Hobbit movie.

“When we finally got the day done, we said goodbye to Orlando, had a couple of beers... and couldn’t resist doing this!” the director wrote.

Watch Orlando Bloom’s “remix”

Here’s the original:

Bloom, who is married to Australian supermodel Miranda Kerr, had his breakout role as the elf prince Legolas in the first “The Lord of the Rings” movie, “The Fellowship of the Ring,” in 2001. He held the role in the second and third LOTR films as well.

His character wasn’t originally included in the 1937 “The Hobbit” novel by J.R.R. Tolkien, but as a fan favourite, he was added in the second and third instalment, “The Desolation of Smaug” and “There and Back Again.”

Another beloved character leaving the production in NZ is Gandalf, played by the esteemed McKellen for 14 years.

“Seconds ago we finished our last shot with Gandalf. The end of an incredible adventure that began in 1999. I’m feeling very sad right now,” Jackson posted along with a photo of him and the 74-year-old multi-awarded English actor.

The Hobbit director and star

McKellen did more than just stay in New Zealand and shoot his parts. He also helped the country rebuild heritage theatre after it was badly damaged by an earthquake in 2011. He raised more than $350,000 for the rehabilitation of the Isaac Theatre Royal in Christchurch.

The theatre’s chief executive, Neil Cox, hoped McKellen would return to the new stage once it reopened next year.

“I’m sure he will come to see it once it’s completed,” he told the New Zealand Herald. “We know he likes New Zealand and he has a lot of friends here, and if he’s looking for some time out sometime in the future, this is the place I’m sure he’ll pop back to.”

“The Hobbit: The Desolation of Smaug” will be released on December 13 this year in New Zealand and Australia, while the “The Hobbit: There and Back Again” will debut in theatres on December 17, 2014.

“The Hobbit: The Desolation of Smaug” trailer: