Gary Glasberg, the longtime showrunner of CBS’ “NCIS” and creator of spinoff “NCIS: New Orleans,” died Wednesday in Los Angeles. He was 50.

CBS said Glasberg died in his sleep.

“Gary was our rock, our cheerleader, our team captain. He inspired us with his leadership, his creative instincts and keen insight,” the “NCIS” cast said in a statement. ” ‘NCIS’ will not be the same without him, and each of us will miss his smiling face and unwavering humor, which lifted us every day.”

The New York City native began his career writing comic books and working on animated series for Hanna-Barbera, Warner Bros., Disney and Nickelodeon. He segued into drama by the early 1990s, working on the staff of such series as UPN’s “Swift Justice” and “Mercy Point,” CBS’ “L.A. Doctors” and Fox’s “The Street.”

Glasberg’s reputation as a writer-producer grew as he advanced to supervising producer and co-exec producer status on such series as NBC’s “Crossing Jordan,” CBS’ “Shark” and Fox’s “Bones.” He joined “NCIS” in 2009 and was upped to exec producer the following year. He had been showrunner of “NCIS” since 2011.

Last year, Glasberg created the spinoff “NCIS: New Orleans,” toplined by Scott Bakula.

On Glasberg’s watch, “NCIS” has maintained its status as TV’s most-watched drama series for the past seven years. Now in its 14th season, “NCIS” last season averaged 20.4 million viewers and 3.1 rating/11 share in adults 18-49.

“Today is an overwhelmingly sad day for ‘NCIS,’ CBS and anyone who was blessed to spend time with Gary Glasberg,” said CBS Entertainment president Glenn Geller. “We have lost a cherished friend, gifted creative voice, respected leader and, most memorably, someone whose warmth and kindness was felt by all around him.”

CBS Television Studios president David Stapf said CBS was “devastated” by the loss of the prolific writer-producer.

“He epitomized the word ‘mensch’ and brought kindness, integrity and class to everything he did. His remarkable talent as a writer and producer was only matched by his ability to connect with people,” Stapf said. “Gary was a beloved member of our family and we are so honored that he called CBS his home for so many years. Our hearts go out to his wife, Mimi, two sons, his entire family and all those who loved him.”

Glasberg’s survivors include his wife of 20 years, screenwriter Mimi Schmir, and two sons, Dash and Eli. He is also survived by his father, Edwin Glasberg, and a sister, Mindy Glasberg.

A memorial service is being planned for October.