Dylan O’Brien has joined Mark Wahlberg in the upcoming action thriller “Infinite,” sources tell Variety.

“Kingsman” actress Sophie Cookson will also appear in the film with “Training Day” director Antoine Fuqua helming.

“Infinite” is based on D. Eric Maikranz’s novel “The Reincarnationist Papers,” which centers on the Cognomina, a secret society of people who possess total recall of their past lives. A troubled young man haunted by memories of two past lives stumbles upon the centuries-old society and decides to join their ranks. Ian Shorr is adapting the story for the screen.

Details of O’Brien’s role have not been revealed.

John Zaozirny will produce the Paramount film alongside Lorenzo di Bonaventura and Mark Vahradian of Di Bonaventura Pictures. Rafi Crohn is the executive producer.

“Infinite” is set to bow Aug. 7, 2020, with production scheduled to begin this fall.

Best known for his roles in MTV’s “Teen Wolf” series and Fox’s “Maze Runner” franchise, O’Brien will appear in two features in the next year: Eone’s mystery thriller “The Education of Fredrick Fitzell” and Paramount’s post-apocalyptic comedy “Monster Problems.” He was most recently seen in the final “Maze Runner” installment, “Maze Runner: The Death Cure.”

O’Brien is repped by WME and Principal Entertainment LA.