Michael Richards, seen here in 2004, stunned a comedy club audience by shouting racial epithets at people who heckled him during a standup routine. ((Louis Lanzano/Associated Press))

Michael Richards, best known for the eccentric character Kramer on the hit TV show Seinfeld, apologized Monday after stunning an audience by shouting racial slurs at hecklers during a standup comedy routine over the weekend.

Appearing via satellite on Late Show with David Letterman during a segment featuring Jerry Seinfeld, Richards indicated he was still reeling from what had happened.

"I took it badly, and I went into a rage and said some pretty nasty things to some Afro-Americans," said Richards.

Richards made the remarkswhile performing at the Los Angeles comedy club The Laugh Factory on Friday night.

After two black audience members told Richards he wasn't funny during his performance,he responded with a series of vicious remarks that were caught on video and broadcast on the internet.

Richards made a reference to lynching, asked for security to throw the two men out, and thentaunted them with repeated use of a racial epithet.

A video of the incident was posted on TMZ, a celebrity website that first drew attention when it posted video of Mel Gibson's anti-Semitic outburst to police officers this summer.

The 57-year-old comic actor acknowledged to Letterman the hostility that sometimes comes out from his uncontrolled standup style, but said he wasn't a racist.

He said he particularly regretted that the incident happened the same weekend fellow comedians were gathering in Las Vegas fora Comic Reliefbenefit aimed at helping victims of Hurricane Katrina, most of whom were African-American.

"For me to be at a comedy club and to flip out and say this crap, I'm deeply, deeply sorry," he said.

Richards began his career as a standup and improv comedian, which landed him his first big role, as a cast member on Fridays, a short-lived competitor to Saturday Night Live.

Richardsadmitted to Lettermanhe was trying to defuse the hecklers by being more outrageous, but that it backfired.

The video from the comedy club shows some audience members chuckling while others gasped,and one person could be heard saying "Oh my God."

Some people in the club begin walking out, as someone says: "It's not funny. That's why you're a reject, never had no shows, never had no movies. Seinfeld, that's it."

Richards said he later went back and talked to some audience members still in attendance to apologize and tryto explain what had occurred.

Seinfeld called his former castmate's remarks "extremely offensive" in a statement released earlier Monday.

"I know how shattered he is about this and he deserves the chance to apologize," Seinfeld said to Letterman.

With files from the Associated Press