Cress Williams has been cast as the lead in the CW’s new DC superhero pilot “Black Lightning,” Variety has learned.

A veteran of the CW’s “Hart of Dixie,” Williams will play Jefferson Pierce, a teacher who hung up his suit and secret identity years ago. But with a daughter hell-bent on justice and a star student being recruited by a local gang, he will be pulled back into the fight as the wanted vigilante and DC legend — Black Lightning.

Originally developed at Fox, “Black Lightning,” was ordered to pilot last month at the CW. It is executive produced by Greg Berlanti, who produces “Riverdale,” “The Flash,” “Arrow,” and “Legends of Tomorrow.” Berlanti’s partner Sarah Schechter also serves as executive producer along with writers Salim Akil and Mara Brock Akil. The pilot is produced by Berlanti Productions and Akil Productions in association with Warner Bros.

The pilot is based on based on the DC character Black Lightning, created by Tony Isabella with Trevor Von Eeden. Williams is represented by APA and manager Sinclair Jones.