LOS ANGELES — George Carlin, the acerbic, Grammy-winning comedian whose career spanned more than 50 years, died of heart failure Sunday after being admitted to a hospital complaining of chest pains, a hospital spokesman said. He was 71.

Carlin, who had a history of heart problems, died at St. John's Health Center in Santa Monica shortly before 6 p.m., said his publicist Jeff Abraham.

The comedian, who toured college campuses for years and made a name for himself using dirty language and delivering biting social commentaries, had released 22 solo albums and three bestselling books.

He finished a show at The Orleans in Las Vegas last week and was planning to take the month off to relax and work on a new book of essays and musings, Abraham said.

Carlin went to the hospital Sunday afternoon because "his heart just didn't feel right," the publicist said.

Carlin starred in a variety of TV and movie roles and gained fame for a routine about the seven dirty words that could not be uttered on television.

"There are three ingredients in my comedy," he said in a 1991 interview with the Los Angeles Times.

"Those three things which wax and wane in importance are English language and wordplay; secondly, mundane, everyday observational comedy — dogs, cats and all that stuff; and thirdly, sociopolitical attitude comedy."

He earned several gold comedy albums and five Emmy nominations.

Carlin was arrested in 1972 in Milwaukee for using indecent language. In a separate case in 1973, a radio listener complained after a station played part of his album. That case went the Supreme Court, which in 1978 ruled in favor of the Federal Communications Commission, saying the radio station could not broadcast those words at times when children could be listening.

Last year, he said a highlight of his career was a 1992 HBO special titled "Jamming in New York."

"That was the point where I probably became more of a writer who performed his own material.

"The material became more like essays, they became more socially conscious, and it was just a major jump from being what I think of as only an entertainer to being an artist-entertainer," he said in a 2007 Times interview.

Last year, Carlin released ''George Carlin: All My Stuff," a 14-DVD collection of his HBO specials from 1977 to 2005.

He had shown no signs of slowing down.

Just last week, the John F. Kennedy Center for the Performing Arts announced Carlin would be awarded the 11th annual Mark Twain Prize for American Humor.

The center is scheduled to honor Carlin at a tribute performance by former colleagues on Nov. 10, which will be broadcast later on PBS. Actor and comedian Billy Crystal won last year's Mark Twain prize.

Carlin was born May 12, 1937, in the Bronx and grew up in New York.

He is survived by wife Sally Wade; daughter Kelly Carlin McCall; son-in-law Bob McCall; older brother Patrick Carlin; sister-in-law Marlene Carlin and longtime manager, business partner and best friend Jerold Hamza. Carlin's first wife, Brenda, died in 1997.