Sean Maguire has already played the legendary Robin Hood, and now he'll take on another familiar figure.

The Once Upon a Time veteran has been cast as James Bond author Ian Fleming in an upcoming episode of NBC's new time-travel drama Timeless, Entertainment Weekly reports.

In "Party at Castle Varlar," Abigail Spencer's Lucy will meet Fleming prior to the start of his writing career, when he was still just an undercover agent for the British. In the episode, which is the fourth of the season, Lucy, Wyatt (Matt Lanter) and Rufus (Malcolm Barrett) will travel to Nazi Germany in their attempt to stop the time-traveling terrorist Flynn (Goran Visnjic).

Once Upon a Time adds Aladdin, Jafar and Buffy alum to Season 6

Sean MaguireSean Maguire

"We knew we couldn't just do a war movie, so where we landed was, 'Alright, then let's do a spy movie,'" executive producer Eric Kripke told the magazine. "We needed a spy in Germany to help our heroes and bring them into this world ... and we turned to our historian, and he said, 'Let me work on it,' and then he comes running in the room an hour later and says, 'Ian Fleming was there!'"

Timeless premieres Monday, Oct. 3, at 10/9c on NBC.