 In 1999 McKellen was cast , again under the direction of Bryan Singer , to play the comic book supervillain Magneto in the 2000 film X @-@ Men and its sequels X2 : X @-@ Men United and X @-@ Men : The Last Stand . While filming X @-@ Men McKellen was cast as the wizard Gandalf in Peter Jackson 's three @-@ film adaptation of The Lord of the Rings ( consisting of The Fellowship of the Ring , The Two Towers , and The Return of the King ) . He received honors from the Screen Actors Guild for Best Supporting Actor in a Motion Picture for his work in The Fellowship of the Ring , and was nominated for the Academy Award for Best Supporting Actor for the same role . He also provided the voice of Gandalf for several video game adaptations of the films . On 10 January 2011 it was officially confirmed that <unk> would reprise the role of Gandalf in the three @-@ part film adaptation of The Hobbit . 
