 NEW YORK — Two nights after one of the most contentious debates in modern presidential history, President Obama and Mitt Romney put aside their political differences on Thursday night to trade jokes and playfully roast each other. Dressed in white tie at a glittering dinner in midtown Manhattan, the two men delivered speeches at the Alfred E. Smith Dinner, the Catholic Archdiocese of New York’s annual charity benefit that every four years hosts the presidential candidates for a lighthearted break from the grueling campaign.“This is the third time that Governor Romney and I have met recently,” Obama said. “As some of you may have noticed, I had a lot more energy in our second debate. I felt really well rested after the nice long nap I had in the first debate.” 
 
 Romney, sitting with his wife Ann a couple seats down on the dais at the Waldorf-Astoria hotel, laughed. “A campaign can require a lot of wardrobe changes — blue jeans in the morning, perhaps, suits for a lunch fundraiser, sport coat for dinner — but it’s nice to finally relax and wear what Ann and I wear around the house,” Romney said. And I have to say, I'm impressed with how well Gov. Mr. Romney, the Republican presidential nominee, began his speech by saying that, “It’s nice to finally relax and wear what Ann and I wear around the house.” 
 
 Noting the large and wealthy audience before them, he said of Mr. Obama: “You have to wonder what he is thinking — so little time, so much to redistribute.” And he took a poke at Mr. Obama’s “you didn’t build that” statement, saying the apostle St. Peter had “so many skeptics and scoffers at the time who were heard to say, ‘If you got a church, you didn’t build that.’ ” 
 
 Mr. Romney also shared his secrets for debate preparation: “First, refrain from alcohol for 65 years before the debate. Big Bird didn’t even see it coming.” And he joked that while he leans on his wife for comfort and support, he said Mr. Obama “has Bill Clinton.” 
 
 Mr. Romney also took his swipes at the news media. And anticipating the coverage of the dinner, he joked that tomorrow’s headlines would read, “Obama Embraced by Catholics; Romney Dines With Rich People.” 
 
 Both men got a lot of laughs. Mr. Obama got his first while the audience was still giving him a standing ovation: “Everyone please take your seats, otherwise Clint Eastwood will yell at them.” 
 
 He was quick to make light of his poor performance in the first debate. I felt really well-rested after the nice long nap I had in the first debate.” He added, “I learned that there are worse things that can happen to you on your anniversary than forgetting to buy a gift.” 
 
 Mr. Obama noted that he and Mr. Romney spent their free time before the dinner in somewhat different pursuits. “Sometimes it feels like this race has dragged on forever,” Mr. Obama said, “but Paul Ryan assured me that we’ve only been running for 2 hours and 50-something minutes.” 
 
 Mr. Obama said that while he and Mr. Romney both have unusual names, Mr. Romney, whose full name is Willard Mitt Romney, goes by his middle name. Obama took some shots at his rival, too, saying, “Earlier today I went shopping at some stores in Midtown. I understand Governor Romney went shopping for some stores in Midtown.” 
 
 And he came prepared with his own retort to Mr. Romney’s “build that” joke, reminiscing about how he used to “love to go to old Yankee Stadium, the house that Ruth built — although he really did not build that.” 
 
 The president took a swipe at Mr. Romney’s running mate, whose claim to have run a sub-three-hour marathon was later proven to be more than an hour too generous. “Of course, world affairs are a challenge for every candidate,” Obama said. The president — whose full name is Barack Hussein Obama — joked, “I wish I could use my middle name.” 
 
 He also mocked Mr. Romney’s turbulent foreign trip, contrasting it with his own overseas trip in 2008, after which he said he was “attacked as a celebrity because I was so popular with our allies overseas.” 
 
 “I have to say I am impressed with how well Governor Romney has avoided that problem,” he said. And I have to say, I’m impressed with how well Governor Romney has avoided that problem.” At that, Obama looked over to make eye contact with Romney and the two laughed. Both candidates landed some good punchlines, poking fun at each other, themselves, and (of course) Vice President Joe Biden. Obama: "I've heard some people say, 'Barack, you're not as young as you used to be. Where’s that golden smile? I’m trying to run a cabinet meeting here.’ ” 
 
 Speaking of Mr. Biden’s animated debate performance, Mr. Romney said: “I heard from the Federal Election Commission: From now on, whenever he appears on TV, there’s a recording of me afterward that says, ‘I’m Mitt Romney and I approve this message.’ ” He added, “I was actually hoping the president would bring Joe Biden along this evening because he will laugh at anything.” 
 
 In a campaign notable for the contempt in which Mr. Romney and Mr. Obama at times seem to hold each other, the dinner at the Waldorf-Astoria to benefit Catholic charities — one of the quadrennial proving grounds on the road to the White House — also lived up to its other billing: a respite, however brief, from a campaign that has grown nastier as it has grown closer, illustrated just a few nights ago during a heated, in-your-face debate at Hofstra University. First, refrain from alcohol for 65 years before the debate.
– The presidential candidates took a break from the campaign to poke fun at themselves and each other last night during the annual Alfred E. Smith charity dinner in Manhattan. Some highlights, from the New York Times and Washington Post: Romney: "As President Obama surveys the Waldorf banquet room with everybody in white tie and finery you have to wonder what he’s thinking: ‘So little time, so much to redistribute.’” Obama: "Earlier today, I went shopping at some stores in Midtown. I understand Governor Romney went shopping for some stores in Midtown." On themselves: Obama: "Some of you may have noticed, I had a lot more energy in our second debate. I felt really well rested after the nice long nap I had in the first debate.” Romney, commenting on the fancy dress code: "It’s nice to finally relax and wear what Ann and I wear around the house.” Odds and ends: Obama asked everyone to “please take their seats. Otherwise Clint Eastwood will yell at them.” Romney tweaked the press, saying he had seen early reports from the dinner. "Headline: ‘Obama Embraced by Catholics, Romney Dines with Rich People.’” On the VP: Obama: "I've heard some people say, 'Barack, you're not as young as you used to be. Where’s that golden smile? Where’s that pep in your step?' And I say, 'Settle down, Joe, I'm trying to run a Cabinet meeting.'" Romney: "I was actually hoping the president would bring Joe Biden along this evening because he will laugh at anything.” See The Week for more highlights.