Kevin Costner may be headed back to the smallscreen.

Costner is in talks to star in Amazon’s new legal drama from David E. Kelley, Variety has learned. Costner has been in talks for the role for the past few weeks, sources say.

“The Trial” marks one of the biggest shows to date for the streaming service and would be Amazon’s first straight to series order. The site usually allows audiences to watch and provide feedback on what pilots should be ordered to series.

This would also mark Costner’s first-ever regular series. His starred in the History Channel miniseries “Hatfield & McCoys.” Costner will play a reputable-lawyer-turned-alcoholic who’s fired from the high-profile firm he co-founded.

David Semel (“Ally McBeal,” “Dawson’s Creek,” “Madam Secretary”) is rumored to direct the pilot, written by Kelley. Costner would also executive produce. Kelley’s most recent credits include CBS’ “The Crazy Ones.” He’s now adapting the novel “Big Little Lies,” starring Nicole Kidman and Reese Witherspoon, as an HBO limited series.

“The Trial” is the latest original series to join Amazon’s growing slate, which includes the comedies “Transparent” and “Alpha House.”

Costner is repped by WME, Zero Gravity Management and Hirsch Wallerstein. Kelley is repped by CAA and Gendler & Kelly.