DC Comics character John Constantine, played by Matt Ryan on the eponymous (and recently cancelled) NBC series, will be coming to The CW’s “Arrow” in season four, it was announced at The CW’s Television Critics Assn. press tour presentation Tuesday.

Ryan will reprise his role for “Arrow” episode 405, titled “Haunted.” In a statement, “Arrow” co-showrunner Marc Guggenheim said of the casting, “We are thrilled to have Matt Ryan reprise the role of John Constantine on an upcoming episode of ‘Arrow.’ Matt is an incredibly talented actor and his portrayal of this beloved character was always something we admired. The introduction of magic and mysticism on the show this season has provided a truly organic opportunity for us to bring John Constantine to ‘Arrow’ and the CW’s DC universe. It will be a well-deserved tip of the hat to all the ‘Constantine’ fans who were so incredibly supportive of that series.”

Executive producer and co-showrunner Wendy Mericle later told Variety that John’s storyline is tied to Sara Lance’s (Caity Lotz) resurrection ahead of her role on “Arrow” and “The Flash” spinoff “DC’s Legends of Tomorrow,” explaining, “We knew Sara was coming back and we wanted to have her soul… she needed to be resurrected, and even in the world of the comic books, he’s the guy to do it. We weren’t sure it was all going to work out, but DC was very generous and Matt Ryan’s schedule worked out and we’re very excited.”

Mericle also pointed out that John fits in with the themes of magic and mysticism the show has been introducing, and noted, “Oliver understands that in a way that maybe other members of the team don’t, so they’ll establish a connection here that’s substantial and hopefully interesting.”

CW president Mark Pedowitz said of Ryan’s appearance, “[‘Constantine’] is no longer on the air, and luckily one of our parent companies, Warner Bros., was the production company for ‘Constantine,’ and we worked with them, and it’s a great one-shot episode.”

According to The CW’s character description, John Constantine is a weather-worn exorcist and expert on the supernatural and the occult. He is a detective, magician, and a hunter of demons, and will provide critical support to Oliver (Stephen Amell) when arrows aren’t enough.

Ryan confirmed the news via his Twitter feed Tuesday. “The rumors are true, John is coming to Star City,” he said in a video message.

“Constantine” was cancelled by NBC in May after a 13-episode run, with fans rallying to save the show via a social media campaign.

Guggenheim previously told Variety that “there’s a lot of desire on everyone’s part” to bring the character into the shared DC TV universe he created with Andrew Kreisberg and Greg Berlanti. “It would be wonderful and we certainly have a million ideas — it’s hard for me to say mainly because A: it’s not my decision to make and B: with ‘Constantine’ being shopped around to other networks… it’s really hard to make plans when a show’s kind of in limbo.”

Now it seems that the character has escaped TV purgatory and will live to hunt demons on The CW.

“It comes up in the writers’ room constantly,” Guggenheim said of how they would integrate John Constantine into the “Arrow” universe during a previous interview with Variety. “We have a number of ideas; one idea that’s particularly exciting to me.”

Also joining “Arrow” in season four are Echo Kellum as Curtis Holt (aka the heroic Mr. Terrific), Neal McDonough as villain Damien Darhk, Jeri Ryan as Jessica Danforth, Casper Crump as immortal villain Vandal Savage, and Falk Hentschel as Carter Hall/Hawkman. Crump and Hentschel will also appear on a crossover episode of “The Flash” before moving over to “DC’s Legends of Tomorrow,” the superhero spinoff slated for midseason.

Ryan is repped by Gersh, Julian Belfrage Associates and Jackoway Tyreman.

“Arrow” season four premieres at 8 p.m. Oct. 7 on The CW.