Mahershala Ali is in talks to star in the third season of “True Detective” at HBO, Variety has confirmed with sources.

While discussions are underway with the Oscar winner, Ali’s deal is not in place — plus, “True Detective” technically has not been greenlit for Season 3, though sources close to the network say the third season is happening.

Plot details for the third season are being kept under wraps, so no word on the character Ali will be playing.

Should Ali officially sign on — as first reported by Tracking Board — his starring role will follow A-listers on “True Detective” including Matthew McConaughey and Woody Harrelson for the first season, and Colin Farrell, Rachel McAdams and Taylor Kitsch in for the second season. Ali would be the first African-American lead in the HBO series.

While “True Detective” hasn’t been renewed for a third season, it’s likely the anthology’s official order is contingent on the cast, along with the quality of the script, so Mahershala’s deal closing will surely speed up the process. After a stellar first season and then a rocky second season, HBO recruited “Deadwood’s” David Milch to collaborate with “True Detective” creator Nic Pizzolatto on the third installment. Pizzolatto was said to have settled on a concept for Season 3 earlier this year, and began working on scripts in March.

Following poor critical response for the second installment, insiders said HBO had been looking to make a change in the way the show is run and presented Pizzolatto with a number of options, including working with a staff of writers and having a new showrunner come on board. The second season struggle is what has stalled an official greenlight for Season 3.

For Ali, the series marks a return to television for the breakout movie star who won an Oscar for “Moonlight” this year, becoming the first Muslim actor to take home an Academy Award. His TV credits include prominent roles in Netflix’s “Luke Cage” and “House of Cards,” among others. He is repped by WME.