Malcolm-Jamal Warner, the Emmy-nominated actor who starred as Theo Huxtable for eight seasons on “The Cosby Show,” has died, The Times has confirmed. He was 54.

Costa Rica’s Judicial Investigation Department told the Associated Press on Monday that Warner drowned Sunday afternoon on a beach on Costa Rica’s Caribbean coast. He was swimming at Playa Cocles in Limon province when a current pulled him deeper into the ocean.

First responders from Costa Rica’s Red Cross found him without vital signs and he was taken to the morgue. Warner was on vacation with his family, People reported.

Representatives for Warner declined to comment immediately Monday.

In addition to acting on “The Cosby Show,” Warner directed five episodes over the final three years of the show.

“Part of the reason I even got into directing is because I realized as an actor you really only have so much creative control over whatever project you’re acting in,” Warner told The Times in 1991. “I felt that, as a director, I would at least have more of a voice.”

He continued, saying, “Directing, as is acting and writing, is an interpretation. And I feel that I have a pretty good sense of how to tell a story. And I think that my interpretation of things is pretty, pretty good.”

Born Aug. 18, 1970, in Jersey City, N.J., Warner amassed dozens of TV credits. Those credits include four seasons as the lead actor on “Malcolm & Eddie” — he directed 17 episodes on that UPN show — and six seasons as A.J. Austin on “The Resident.”

Other appearances included work on “Sons of Anarchy,” “Major Crimes,” “Girlfriends’ Guide to Divorce” and “Suits.”

Warner also won a Grammy for traditional R&B performance in 2015, for the song “Jesus Children” and was nominated for spoken word poetry album in 2023.

Of course, he was asked for his thoughts on co-star Bill Cosby when Cosby was accused of rape in 2015.

“He’s one of my mentors, and he’s been very influential and played a big role in my life as a friend and mentor,” Warner told Billboard. “Just as it’s painful to hear any woman talk about sexual assault, whether true or not, it’s just as painful to watch my friend and mentor go through this.”

The Associated Press contributed to this report.