Ted Danson is heading back to CBS, signing on for a series regular role on “CSI.”

Danson will play the new CSI team supervisor on the veteran drama, which is undergoing a cast shuffle in its 12th season. Longtime femme lead Marg Helgenberger is transitioning off the show but will appear in the bulk of next season’s segs. Laurence Fishburne exited at the close of last season.

Even as Danson moves back to network primetime, he will continue his role on the offbeat HBO laffer “Bored to Death.” Thesp made that a stipulation of his deal with CBS.

“You can create a new character on the page, but until the perfect actor comes along and breathes life into it, it’s just words,” said “CSI” exec producer Carol Mendelsohn. “We’re very excited Ted Danson came along.”