The “Magnum P.I.” reboot pilot has cast Jay Hernandez as the titular private eye, Variety has learned.

Hernandez will play Thomas Magnum, a decorated ex-Navy SEAL who, upon returning home from Afghanistan, repurposes his military skills to become a private investigator. Tom Selleck, who currently stars in the CBS drama “Blue Bloods,” played the role in the original series.

Hernandez’s recent film roles include the DC Entertainment film “Suicide Squad” and appearances in both entries in the “Bad Moms” comedy franchise. He has also appeared in films like “Friday Night Lights,” “Hostel,” and in the Netflix fantasy-action film “Bright.” On the television side, he has recently appeared in “Scandal,” “Nashville,” and “The Expanse.”

He is repped by ICM Partners, Alchemy Entertainment and Fuller Law.

Peter Lenkov, the writer and producer behind current CBS reboots of “Hawaii Five-O” and “MacGyver,” will serve as the writer and executive producer on the new version of “Magnum P.I.,” which had previously gotten a pilot production commitment at the network. Eric Guggenheim, an executive producer and writer on Lenkov’s “Hawaii Five-O,” will also write and executive produce. John Davis and John Fox of Davis Entertainment will also executive produce along with Danielle Woodrow. Justin Lin will direct the pilot and executive produce. CBS Television Studios will co-produce with Universal Television.

This is one of several such projects ordered to pilot at CBS. CBS has also ordered a pilot for a reboot of the female-led cop drama “Cagney and Lacey,” as well as an adaptation of “LA Confidential” and a revival of “Murphy Brown.”