We reported yesterday that Constantine would be appearing in an episode of Arrow. Now we know what role he’ll be playing.

Matt Ryan’s Constantine, the titular character of the canceled NBC series, will appear in Arrow season 3, episode 5, “Haunted.”

EP Wendy Mericle said at the Television Critics Association press tour that Constatine’s guest appearance on Arrow “was born more out of the storyline for Sara Lance. We needed someone to come in and help bring her back. He felt like the most exciting possibility, and we’re just thrilled to get him. He brings such a different element to the show.”

Related: 5 things we learned from the Arrow Comic-Con panel

This is significant, of course, because Sara Lance will be a main character in the upcoming Arrow/Flash spinoff, Legends of Tomorrow as White Canary. The trailer revealed that Sara, who was murdered in the Arrow season 3 premiere, will be revived via the Lazarus Pit. However, the details surrounding her resurrection have been a closely-guarded secret — until now.

Added EP Marc Guggenheim, “Unlike Thea, who wasn’t fully dead, the consequences of using the Pit on someone as dead as Sara was creates some unforeseen difficulties…and John Constantine is uniquely suited to help our team deal with those.”

Moreover, the Constantine character fits into the planned themes of season 4. “Each year on the show, we have added and expanded the mythology with different elements. In season 2 we introduced the idea of superpowers, last year brought in the League of Assassins, and for season 4, we always had a plan to introduce magic and mysticism,” Guggenheim explained.

With the Lazarus Pit, “[w]e were already swimming in those waters, and that’s why Constantine is this great organic little development.”

Related: Arrow at SDCC: Talking dynamics in the “Arrow” cave and Damien Darhk

As for whether Constantine might appear on future episodes of Arrow, Mericle said, “Right now, it really was — it’s born out of necessity for this particular story,” adding, “[I]t is a one off, and this is what we’re focusing on right now.”

Arrow season 4 premieres Wednesday, October 7 at 8:00 p.m. ET on The CW.

Are you looking forward to seeing John Constantine on ‘Arrow’?