NEW YORK, May 26 (UPI) --James McAvoy and Patrick Stewart -- who play the iconic film character Professor Charles Xavier at different ages -- say they relished the rare chance to share the screen in X-Men: Days of Future Past.

Directed by Bryan Singer, the film follows Hugh Jackman's superhero Wolverine as his consciousness travels back to his 1970s-era body and tries to persuade benevolent professor Charles Xavier, and Xavier's rival Magneto, played by Michael Fassbender, to team up and stop a war profiteer from using machines he developed to destroy all mutants.

McAvoy and Fassbender previously played the roles of Charles and Magneto in the 2011, 1960s-set prequel, X-Men: First Class, while Jackman, Stewart and Ian McKellen played Wolverine, Charles and Magneto in 2000's X-Men, 2003's X-2: X-Men United and 2006's X-Men: The Last Stand.

Days of Future Past features McAvoy, Fassbender, McKellen and Stewart as the characters in their respective time periods, with Wolverine acting as a bridge between the eras. One memorable scene shows the two incarnations of Charles briefly meeting face-to-face.

"I'm not quite sure how it came about that we were nose-to-nose like that, but I can't now think of any other possible way of making the scene work because you are looking into the eyes of yourself," Stewart said at a recent New York press conference.

"It was James' first day of work on the movie and it was my last day of work on the movie. My bags were packed and I was ready to get out of Dodge. I don't recall rehearsing it. We knew the lines and they rolled the camera. I think it was 40 minutes work, as far as I can recall. I shouldn't have said all that. I should have said we worked on it for weeks. The two of us and Bryan and the crew. But it actually wasn't like that at all."

McAvoy, who was sitting beside Stewart on the panel, confessed, "Getting to come and do my version of a character that he has been in charge of for 14 years -- at his face -- was quite nerve-wracking.

"So, you've got the two choices -- either you get nervous and let that overcome you or you get quite excited about the fact that you might fail, so it was good fun," McAvoy said.

Turning to Stewart, he revealed, "I've been watching you for years -- since I was 10 or 11. ...

"And your characteristics and idiosyncrasies, I know them quite well, as a performer, anyway. But the key thing was watching the empathy that pours out of you in the previous movies and I hoped in the First Class to be able to emulate that particularly because it is kind of the prime characteristic of Professor Xavier -- this willingness to care and reach out and help," McAvoy said.

"It made me feel that I'd really like to get back and shoot all the other movies again, now that I know exactly where I came from and what I was," Stewart added. "I could get so much more James McAvoy into that performance."

Co-starring Jennifer Lawrence, Nicholas Hoult and Peter Dinklage, X-Men: Days of Future Past was No. 1 at the North American box office when it opened this past weekend.

United Press International is a leading provider of news, photos and information to millions of readers around the globe via UPI.com and its licensing services.

With a history of reliable reporting dating back to 1907, today's UPI is a credible source for the most important stories of the day, continually updated - a one-stop site for U.S. and world news, as well as entertainment, trends, science, health and stunning photography. UPI also provides insightful reports on key topics of geopolitical importance, including energy and security.

A Spanish version of the site reaches millions of readers in Latin America and beyond.

UPI was founded in 1907 by E.W. Scripps as the United Press (UP). It became known as UPI after a merger with the International News Service in 1958, which was founded in 1909 by William Randolph Hearst. Today, UPI is owned by News World Communications.