Eddie Murphy riffs on Bill Cosby as he delivers his first joke onstage in over 28 years, while receiving the Mark Twain Prize. (AP)

Eddie Murphy showed his appreciation for receiving the Mark Twain Prize for American Humor at the Kennedy Center on Sunday night by doing something he hasn’t done in almost 30 years.

He did a mini stand-up set, telling a few jokes and even doing his impression of disgraced comedian Bill Cosby.

“Bill has one of these,” he said, looking at the bust of Mark Twain with an exaggerated, embarrassed smile. (Cosby was honored in 2009.) “Did you all make him give it back?” he asked, before adopting the persona of Cosby.

“I would like to talk to some of the people who feel like I should give back some of my [expletive] trophies,” he said to the delight of the sold-out crowd.

Murphy had declined to do his Cosby impression at the 40th anniversary celebration of “Saturday Night Live” earlier this year. But he looked exuberant to be back in his stand-up element as he told jokes onstage for the first time since 1987.

He riffed for about five minutes. He asked whether the Twain honor is an award or a prize.

“When it’s a prize, there’s usually money involved,” he said. “I thought I was going to get paper. . . . For future recipients, if you don’t want to call it an award, you could call it a surprise — the surprise being you ain’t getting any money.”

Flashing his trademark impish grin, the comedian looked pleased by the applause and riotous laughter.

Murphy decided a few weeks ago to perform at the ceremony, his friend Arsenio Hall said after the show. He practiced Saturday in a hotel room with Hall and fellow comedian Chris Rock.

Eddie Murphy was accompanied by an all-star cast at the Kennedy Center, where he received the Mark Twain Prize. (Erin Patrick O'Connor/The Washington Post)

Throughout Sunday evening, every Eddie Murphy you’ve ever known and loved showed up at the Kennedy Center: the streetwise Mr. Rogers, the fat-suited Nutty Professor, James Brown prancing around a hot tub, the wisecracking donkey from “Shrek.” They all appeared in video tributes while the man who embodied those characters — and many more — sat in a booth reserved for the prize recipient. His entourage included six of his eight children, his mother, and his girlfriend, Paige Butcher, an Australian model.

More than a dozen friends and colleagues saluted his brilliance, comparing him with the trail-blazing Richard Pryor — a previous Twain Prize recipient — and thanking him for paving the way for their success.

“He made me who I am today,” Rock said. “He taught me about show business. He taught me about comedy. He taught me about white people.”

Hall launched the two-hour celebration by describing the breadth of Murphy’s comedic gifts: his stand-up, his characters, his fearless riffs on society. He cited Murphy’s early HBO special, “Delirious” (recorded at Washington’s DAR Constitution Hall), as evidence of his audacity.

“Eddie did black people, Eddie did white people,” Hall said. “Eddie explained the power of ice cream trucks. Eddie took us to his family barbecue, and he did this while wearing a red leather suit.”

The assembled cast of comics and performers included SNL alums Kevin Nealon, Joe Piscopo and Tracy Morgan — fresh from hosting the show Saturday after recovering from the severe injuries he sustained in a car accident last year.

Morgan, who brought Murphy and the crowd to their feet, said he knew the reason the producers asked him to appear. “They know I love Eddie Murphy and they know I have a huge following on PBS,” he said. “Richard Pryor inspired me, but Eddie Murphy made that dream seem like a reality.”

In between the tributes were clips of Murphy’s first appearance on “The Tonight Show” and bits from the movies “Trading Places” and “Shrek.” There were surprisingly few curse words to be bleeped when the show airs on PBS on Nov. 23.

Although he has been out of the spotlight in recent years, Murphy, 54, spent decades in it. In 1980 — at 19 — he joined the cast of SNL, rescuing the late-night variety show with sketches featuring his own versions of Gumby, Buckwheat and children’s TV favorite Mr. Rogers. (Murphy once announced “ransom” as the word of the day of his version, Mr. Robinson.)

He became one of the most commercially successful African American actors, with starring turns in “48 Hrs.,” “Beverly Hills Cop” and “Trading Places.” He made his directing debut with “Harlem Nights” and earned an Oscar nomination for his role as James “Thunder” Early in “Dreamgirls.”

“As edgy as Eddie was on the stage, his films, the whole family could watch,” George Lopez said before introducing a clip from “The Nutty Professor.”

Kathy Griffin mentioned Murphy’s “mystique,” saying the comedian “makes Prince look accessible and approachable.”

Comedian Eddie Murphy is receiving the 2015 Mark Twain Prize for humor. Here is a look back at his iconic career as a member of "Saturday Night Live," countless movies and a few stand-up specials. (The Washington Post)

Murphy is the 18th recipient of the annual award, which honors a lifetime contribution to American humor. Pryor received the first one in 1998; last year, Jay Leno was honored. Other recipients include Carl Reiner, Neil Simon, Carol Burnett, Tina Fey and Billy Crystal.

South African comedian and “Daily Show” host Trevor Noah said watching “Coming to America” changed his life. “We watched that movie like a documentary. We had never seen Africans in America before,” he said. “For the first time, I saw someone out there who saw us. I am part of your legacy.”

Murphy returned the appreciation to his friends and colleagues. “This was a wonderful night,” he said onstage. “I love you all; thank you so much.”