Obama also took a shot at the Republican congressional leadership, whom he thanked "for taking time from their exhausting schedule of not passing any laws" to attend the dinner.
Four years ago, Obama recalled, he was locked in a tough primary fight with Hillary Rodham Clinton, now his secretary of state. "She can't stop drunk texting me from Cartagena," he said, referring to their recent trip to the Summit of the Americas in Colombia, where Clinton was photographed drinking a beer and dancing.
This year, Obama is the incumbent, but the dinner was far from a campaign-free zone. The president pointed out his similarities with the presumed Republican nominee, Mitt Romney.
"We both think of our wives as our better halves, and the American people agree to an insulting extent," the president said.
"We both have degrees from Harvard. I have one, he has two. What a snob."
The crack drew a thumbs up from former Pennsylvania Sen. Rick Santorum, who was in the audience. Santorum dropped out of the presidential primary campaign earlier this month. He had called Obama a snob for encouraging young Americans to attend college.