Malcolm-Jamal Warner, the actor who played teenage son Theo Huxtable on The Cosby Show, has died at age 54 in an accidental drowning in Costa Rica, according to authorities.

Costa Rica’s Judicial Investigation Department said on Monday, local time, that Warner drowned on 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.

“He was rescued by people on the beach,” the department’s initial report said, but first responders from Costa Rica’s Red Cross found him without vital signs and he was taken to the morgue.

Two men sit and look at each other on a red dotted table with a jug of orange juice next each other

Bill Cosby acts with Malcolm-Jamal Warner in a scene from The Cosby Show. (Getty Images: Jacques M Chenet/CORBIS/Corbis)

Warner created many TV moments etched in the memories of generation X children and their parents, including a pilot-episode argument with Bill Cosby’s Cliff Huxtable about money and an ear piercing he tries to hide from his dad.

His character, Theo, was the only son among four daughters in the household of Cliff Huxtable and Phylicia Rashad’s Clair Huxtable on the NBC sitcom, and he would be one of the prime representations of American teenage boyhood on a show that was the most popular in America for much of its run from 1984 to 1992.

He played the role for eight seasons in all 197 episodes, winning an Emmy nomination for supporting actor in a comedy in 1986.

For many, the lasting image of the character, and of Warner, is of him wearing a badly botched mock designer shirt sewn by his sister, Denise, played by Lisa Bonet.

Loading Instagram content

Warner, who was born on August 18, 1970, grew up in Jersey City, New Jersey, with his mother, Pamela, who eventually became his acting manager.

He was named after civil rights leader Malcolm X and jazz musician Ahmad Jamal.

At an early age, Warner found he was interested in acting, which launched his career as a child performer and set him on the path to attend The Professional Children’s School in New York.

Warner later appeared on the sitcom Malcolm & Eddie, co-starring with comedian Eddie Griffin in the series on the defunct UPN network from 1996 to 2000.

In the 2010s, he starred opposite Tracee Ellis Ross as a family-blending couple for two seasons on the BET sitcom Read Between The Lines.

He also had a role as OJ Simpson’s friend Al Cowlings on American Crime Story and was a series regular on Fox’s The Resident.

His film roles include the 2008 rom-com Fool’s Gold with Matthew McConaughey and Kate Hudson.

A poet and a musician, Warner was a Grammy winner for best traditional R&B performance and was nominated for best spoken word poetry album for Hiding in Plain View.

Warner was married with a daughter, but chose to not publicly disclose their names. Warner’s representatives declined immediate comment.

AP