WASHINGTON — President Barack Obama joked Saturday that the years are catching up to him and he’s not “the strapping young Muslim socialist” he used to be.

Obama poked fun at himself as well as some of his political adversaries during the annual White House Correspondents’ Association dinner attended by politicians, members of the media and Hollywood celebrities.

Entering to the rap track “All I Do Is Win” by DJ Khaled, Obama joked about how re-election would allow him to unleash a radical agenda. But then he showed a picture of himself golfing on a mock magazine cover of “Senior Leisure.” “I’m not the strapping young Muslim Socialist that I used to be,” the president remarked, and then recounted his recent 2-for-22 basketball shooting performance at the White House Easter Egg hunt.

But Obama’s most dramatic shift for the next four years appeared to be aesthetic. He presented a montage of shots featuring him with bangs similar to those sometimes sported by his wife. “So we borrowed one of Michelle’s tricks,” Obama said. “I thought this looked pretty good, but no bounce.”

Obama closed by noting the nation’s recent tragedies in Massachusetts and Texas, praising Americans from first responders to local journalists for serving the public good.

Saturday night’s banquet not far from the White House attracted the usual assortment of stars from Hollywood and beyond. Actors Kevin Spacey, Julia Louis-Dreyfus and Claire Danes, who play government characters on series, were among the attendees, as was Korean entertainer Psy. Several Cabinet members, governors and members of Congress were present.

And despite coming at a somber time, nearly two weeks after the deadly Boston Marathon bombing and 10 days after a devastating fertilizer plant explosion in West, Texas, the president and political allies and rivals alike took the opportunity to enjoy some humor. Late-night talk-show host Conan O’Brien headlined the event.

Some of Obama’s jokes came at his rivals’ expense. He asked that the GOP’s minority outreach begin with him as a “trial run” and said he’d take his recent charm offensive with Republicans on the road. “In fact, I’m taking my charm offensive on the road — a Texas barbecue with Ted Cruz, a Kentucky bluegrass concert with Rand Paul, and a book-burning with Michele Bachmann,” Obama joked.