(Reuters) - Dick Gregory, a comedian who lambasted racism and played a prominent role in the 1960s civil rights movement after becoming one of the first black comics to perform for white audiences, died on Saturday at age 84, his son said.

FILE PHOTO - Activist Dick Gregory delivers a speech during a public viewing and funeral for legendary singer James Brown in Augusta, Georgia December 30, 2006. REUTERS/Lucas Jackson/File Photo

“It is with enormous sadness that the Gregory family confirms that their father, comedic legend and civil rights activist Mr. Dick Gregory departed this earth tonight in Washington, D.C.,” his son, Christian, wrote on Instagram.

Gregory, who lived in Washington, died of heart failure in Sibley Memorial Hospital, where he had checked in a week ago after falling ill, said his longtime publicist Steve Jaffe.

Gregory’s success as a comedian in the early 1960s helped pave the way for other black comics, such as Richard Pryor, to gain greater fame by reaching a mainstream audience.

Born in St. Louis, Gregory grew up in poverty. He was working for the U.S. Postal Service and performing in front of largely black audiences for low pay when Playboy founder Hugh Hefner saw his act and hired the comedian to perform at his nightclub in 1961.

At the time, stand-up comedy was largely segregated.

“When I started, a black comic couldn’t work a white nightclub,” Gregory told the Florida Times-Union. “You could sing, you could dance, but you couldn’t stand flat-footed and talk - then the system would know how brilliant black folks was.”

Soon after his break at the Playboy Club, Gregory recorded a number of comedy albums and appeared on television talk shows, becoming one of the highest paid black entertainers in the early 1960s.

Gregory’s stand-up comedy tackled racism, often with quips that took his audience by surprise. “Segregation is not all bad,” he once joked. “Have you ever heard of a collision where the people in the back of the bus got hurt?”

Slideshow ( 2 images )

If his comedy routine was at times disarming, his civil rights activism left no doubt where he stood.

Gregory was arrested several times for taking part in demonstrations in the 1960s, befriending the late Martin Luther King Jr. as he used his fame to help push for desegregation.

The comedian also protested the Vietnam War, took part in hunger strikes and ran for U.S. president in 1968 as a write-in candidate for the obscure Peace and Freedom Party.

In the early 1970s, Gregory left stand-up comedy to spend more time on political activism. In the 1980s, he turned his focus to promoting healthy eating and became a diet food entrepreneur. He returned to stand-up in the 1990s.

This month, he was in the middle of a comedy tour when he became ill, Jaffe said.

Gregory still had a lot to say about politics and race relations in the United States.

He made his last post on Twitter on Tuesday, days after a fatal clash between white nationalists and counter-protesters elicited seemingly contradictory statements by President Donald Trump that galvanized his political opponents.

“I’ve so much to say and can’t wait to get out of here to say it,” Gregory wrote from his hospital bed. “We have so much work still to be done, the ugly reality on the news this weekend proves just that.”

Gregory, in a 2011 interview with Reuters, played down the importance that an entertainer alone could have in bringing about social change.

“People like glamour,” he said. “That’s what messes up America.”