Before making the spy thriller “American Assassin,” it wasn’t a sure thing that Dylan O’Brien would ever go back to making movies.

“It’s been a really long and really tough, and really emotional, journey, to be honest,” O’Brien said in a phone interview recently, ahead of the movie’s nationwide release Friday. “I was going through a really tough time.”

O’Brien suffered a life-threatening accident in March 2016 on the set of “The Death Cure,” the third movie in “The Maze Runner” franchise, in which the 26-year-old actor plays the main character. The accident involved a motorcycle sliding out of control after a stunt on the film’s set in Vancouver, British Columbia.

The accident “broke most of the right side of my face,” O’Brien said, and gave him a severe trauma to the brain.

“I’m all fixed up now,” O’Brien said, adding that reconstructive surgery has given him “four plates that will be a part of me forever. I feel really lucky to have come away from it — in terms of coming away from it at all on the day, and really how my face has healed. I was really lucky with a really brilliant doctor, and he salvaged a lot of what I used to look like. … To anybody who saw me after it happened, I think it’s really astonishing how well everything healed and how my doctors fixed me up.”

Making “American Assassin,” which started filming seven months after the accident, “was a big part of me getting back on my feet,” O’Brien said. “It really ended up being hugely cathartic for me, and showed me that I could do it again and get back on a set. And not just any set, but something like this, and really tackle it head-on.”

It wasn’t easy, though. “It’s the absolutely scariest thing I’d ever gone through, the hardest thing I’d experienced after the accident,” he said. “At the same time, it was also the best thing I could have done for myself.”

“American Assassin” would be a tough movie for an actor in most circumstances. It’s a rough-and-tumble spy thriller about CIA assassins, with fight scenes aplenty, and location shooting in London, Rome and Thailand.

In the movie, adapted from Vince Flynn’s beach-read best-seller, O’Brien plays Mitch Rapp, who becomes obsessed with infiltrating a terrorist cell. His efforts draw the attention of a CIA official (Sanaa Lathan) who recruits him to join a secret assassination unit — and to be handled by a hard-as-nails trainer, played by Michael Keaton.

This image released by Lionsgate shows Michael Keaton in a scene from,
This image released by Lionsgate shows Michael Keaton in a scene from, "American Assassin." (Christian Black/Lionsgate via AP)

The movie makes an impact in the first minutes, when a pre-obsession Mitch sees his world torn apart on an Ibiza beach when terrorists attack, killing his fiancée (Charlotte Vega).

The opening, O’Brien said, “was very edgy, very fresh, and most importantly believable. … This is how this guy comes to find this path in his life. That was something that was really interesting to me, and something that I buy.”

O’Brien said he went through serious training to prepare for the role. “I had really no familiarity with grappling or jiujitsu fighting styles,” he said. “The physical training each day was when I started to get into the headspace and the physicality, and build the character from there.”

(Christian Black | CBS Films / Lionsgate) Dylan O'Brien stars as a CIA recruit in the action thriller
(Christian Black | CBS Films / Lionsgate) Dylan O'Brien stars as a CIA recruit in the action thriller "American Assassin."

That training pays off in one of the movie’s climax scenes, when Mitch goes mano a mano with the villain, played by Taylor Kitsch.

“He’s a really normal, down-to-earth dude,” O’Brien said of Kitsch. “He’s also really focused as an actor, and he’s disciplined with prep, and how he goes about it. … He really thinks about his stuff. He’s somebody who really prides himself on his prep. When it comes down to it on the day, he really takes each scene to its fullest potential.”

Actor Dylan O'Brien, left, and Taylor Kitsch attends the special screening of
Actor Dylan O'Brien, left, and Taylor Kitsch attends the special screening of "American Assassin" at the iPic Theater on Wednesday, Sept. 6, 2017, in New York. (Photo by Brad Barket/Invision/AP)

Working with Keaton, who was doing the action-movie thing in “Batman” before O’Brien was born, was a thrill.

“He’s everything I would have wanted Michael Keaton to be,” O’Brien said. “He really understands this business. … I think he really understands what works. He thinks really logically about character and story, and he’s got a really good sense of what’s believable and what’s not. He’s a really big part of what keeps this really grounded.”

After “American Assassin” wrapped late last year, O’Brien went back to work on “The Death Cure.” The production was delayed a year to accommodate his recovery. The movie, based on James Dashner’s dystopian book series, is set for release in January.

After that, O’Brien has no set plans.

“I’m just going to take some time,” he said. “Hopefully, I’ll just have some time at home with friends and family, have the holidays. And then we’ll see what my next venture will be.”