Erik Lehnsherr, also known as Magneto, is a fictional character in the X-Men film series, starting with X-Men (2000) and appearing in eight films ending with X-Men: Dark Phoenix (2019). The 2000 film is also accompanied with two prequel comic books, of which one is about Magneto. He was portrayed by actor Ian McKellen in the first three films and by Michael Fassbender in the four prequel films, starting with X-Men: First Class (2011). McKellen also has a cameo in The Wolverine (2013) while X-Men: Days of Future Past (2014) features both Fassbender and McKellen portraying the character in different time periods. The character is a live action adaption of the comics character Magneto from Marvel Comics, primarily appearing in their X-Men line of comics.