LOS ANGELES — Dick Gregory, the comedian and activist and who broke racial barriers in the 1960s and used his humor to spread messages of social justice and nutritional health, has died. He was 84.

Gregory died late Saturday in Washington, D.C. after being hospitalized for about a week, his son Christian Gregory told The Associated Press. He had suffered a severe bacterial infection.

As one of the first black standup comedians to find success with white audiences, in the early 1960s, Gregory rose from an impoverished childhood in St. Louis to win a college track scholarship and become a celebrated satirist who deftly commented upon racial divisions at the dawn of the civil rights movement.

"Where else in the world but America," he joked, "could I have lived in the worst neighborhoods, attended the worst schools, rode in the back of the bus, and get paid $5,000 a week just for talking about it?"

Gregory's sharp commentary soon led him into civil rights activism, where his ability to woo audiences through humor helped bring national attention to fledgling efforts at integration and social equality for blacks.

Democratic Sen. Cory Booker of New Jersey tweeted, "Dick Gregory's unflinching honesty and courage, inspired us to fight, live, laugh and love despite it all." A tweet by actress/comedian Whoopi Goldberg said, "About being black in America Dick Gregory has passed away, Condolences to his family and to us who won't have his insight 2 lean on R.I.P"

Gregory briefly sought political office, running unsuccessfully for mayor of Chicago in 1966 and U.S. president in 1968, when he got 200,000 votes as the Peace and Freedom party candidate. In the late '60s, he befriended John Lennon and was among the voices heard on Lennon's anti-war anthem "Give Peace a Chance," recorded in the Montreal hotel room where Lennon and Yoko Ono were staging a "bed-in" for peace.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

An admirer of Gandhi and Martin Luther King Jr., Gregory embraced nonviolence and became a vegetarian and marathon runner.

He preached about the transformative powers of prayer and good health. Once an overweight smoker and drinker, he became a trim, energetic proponent of liquid meals and raw food diets. In the late 1980s, he developed and distributed products for the popular Slim-Safe Bahamian Diet.

When diagnosed with lymphoma in 2000, he fought it with herbs, exercise and vitamins. It went in remission a few years later.

He took a break from performing in comedy clubs, saying the alcohol and smoke in the clubs were unhealthy and focused on lecturing and writing more than a dozen books, including an autobiography and a memoir.

Dick Gregory speaks at the 2011 funeral for singer James Brown. Lucas Jackson / Reuters

Gregory went without solid food for weeks to draw attention to a wide range of causes, including Middle East peace, American hostages in Iran, animal rights, police brutality, the Equal Rights Amendment for women and to support pop singer Michael Jackson when he was charged with sexual molestation in 2004.

"We thought I was going to be a great athlete, and we were wrong, and I thought I was going to be a great entertainer, and that wasn't it either. I'm going to be an American Citizen. First class," he once said.

Richard Claxton Gregory was born in 1932, the second of six children. His father abandoned the family, leaving his mother poor and struggling. Though the family often went without food or electricity, Gregory's intellect and hard work quickly earned him honors, and he attended the mostly white Southern Illinois University.

"In high school I was fighting being broke and on relief," he wrote in his 1963 book. "But in college, I was fighting being Negro."

He started winning talent contests for his comedy, which he continued in the Army. After he was discharged, he struggled to break into the standup circuit in Chicago, working odd jobs as a postal clerk and car washer to survive. His breakthrough came in 1961, when he was asked to fill in for another comedian at Chicago's Playboy Club. His audience, mostly white Southern businessmen, heckled him with racist gibes, but he stuck it out for hours and left them howling.

That job was supposed to be a one-night gig, but lasted two months — and landed him a profile in Time magazine and a spot on "The Tonight Show."

Vogue magazine, in February 1962, likened him to Will Rogers and Fred Allen: "bright and funny and topical ... (with) a way of making the editorials in The New York Times seem the cinch stuff from which smash night-club routines are rightfully made." ''I've got to go up there as an individual first, a Negro second," he said in Phil Berger's book, "The Last Laugh: The World of Stand-up Comics." ''I've got to be a colored funny man, not a funny colored man."

His political passions were never far from his mind — and they hurt his comedy career. The nation was grappling with the civil rights movement, and it was not at all clear that racial integration could be achieved. At protest marches, he was repeatedly beaten and jailed.

He remained active on the comedy scene until recently, when he fell ill and canceled an August 9 show in San Jose, California, followed by an August 15 appearance in Atlanta. On social media, he wrote that he felt energized by the messages from his well-wishers, and said he was looking to get back on stage because he had a lot to say about the racial tension brought on by the gathering of hate groups in Virginia.

"We have so much work still to be done, the ugly reality on the news this weekend proves just that," he wrote.

He is survived by his wife, Lillian, and 10 children.