Josh Brolin will play the key role of Cable opposite Ryan Reynolds in “Deadpool 2.”

Michael Shannon had been the frontrunner for the role, but the studio and Marvel have opted for Brolin, who has appeared in the Marvel Cinematic Universe as the villain Thanos.

An official release date for the sequel has not yet been announced. “John Wick” co-director David Leitch came on board to lead “Deadpool 2” last fall after Tim Miller dropped out due to creative differences with Reynolds. The superhero sequel also recently cast “Atlanta” breakout Zazie Beetz as the mutant mercenary Domino.

“Deadpool” gave Fox its biggest hit of 2016 after opening on Valentine’s Day to $782.6 million worldwide, supplanting “The Matrix Reloaded” to become the highest-grossing R-rated film in history.

Cable, a.k.a. Nathan Summers, was often paired with Deadpool in the Marvel comics — the characters even had their own 50-issue series. In the Marvel comics, he was transported as an infant to the future, where he grew into a warrior, before returning to the present.

Cable’s involvement goes all the way back to the first “Deadpool,” where the foul-mouthed mercenary himself teased that he’d be in the sequel during the film’s post-credits scene. In the “Deadpool” scene that was shown ahead of “Logan” in theaters, a message written on a phonebooth read, “Nathan Summers cumming [yes, that’s the correct spelling] soon!”

Brolin will be seen next in Lionsgate’s “Granite Mountain” and with Benicio del Toro in “Soldado,” the sequel to “Sicario.” He also appears in George Clooney’s “Suburbicon” which opens Nov. 3. He is repped by CAA and Ziffren Brittenham.

Reynolds acknowleged the casting of Brolin in a humorous tweet on his Twitter account a few hours after the announcement: