For a president whose reelection slogan is “Forward,” President Obama has spent a lot of time looking backward on the campaign trail lately, invoking the ghosts of his predecessor, George W. Bush, at nearly every turn to remind voters what a mess he inherited in 2009.

Without mentioning Bush by name, Obama inveighs against the 43rd president's policies, from tax cuts for wealthy folks “who didn’t need them” to two wars “waged on a credit card.” He lambastes the lax regulation of Wall Street and the widening income gap that led to “the worst economic crisis since the Great Depression,” as he put it during a fundraiser at the Fox Theatre in Redwood City, Calif., last week.

“We built a house of cards, and it ended up collapsing . . . lost 3 million jobs while we were campaigning, 800,000 jobs lost the month I took office,” Obama told his supporters. Even his historic sweep in 2008 had less to do with the charismatic senator from Illinois, the president professed, than the pent-up frustration of an electorate that felt “the country had strayed from some of those basic values.”

It’s an election-year strategy that aims to tie Republican challenger Mitt Romney to the failed policies of the Bush White House, while also allowing Obama to offer an explanation — his critics might call it an excuse — for why the nation’s economy still has such a long way to go despite his 31 / 2 years in charge.

On Thursday, however, Obama toned down his attacks for a couple of hours when Bush and former first lady Laura Bush returned to the White House for the first time to participate in the formal unveiling of their official portraits.

Suddenly the old ghosts had awoken, as the East Room was overrun by a who’s who of Bush-era power brokers seated throughout the ornate ballroom. There were retired Gens. Colin L. Powell and David H. Petraeus, former attorney general Alberto R. Gonzales, and former defense secretary Donald H. Rumsfeld.

And there — second row, center aisle — was GOP political operative Karl Rove, chatting amiably with Vice President Biden. Rove’s political action committee, Crossroads GPS, has pledged to spend tens of millions of dollars to defeat Obama.

For a moment, anyway, the political hatchet was buried. Obama and first lady Michelle Obama strolled into the East Room with the Bushes at their side, all of them smiling as the onlookers stood and applauded. Bush’s father, the 41st president, George H.W. Bush, sat in a wheelchair in the front row, physically frail but sartorially splendid in patriotic red-white-and-blue-striped socks.

Before this audience, Obama reframed his campaign-trail narrative, casting his predecessor as a patriot.

“The months before I took the oath of office were a chaotic time. We knew our economy was in trouble, our fellow Americans were in pain,” Obama told the crowd of Republicans. But, he continued, Bush and his advisers helped make the transition of power as seamless as possible.

“President Bush understood that rescuing our economy was not just a Democratic or a Republican issue; it was an American priority,” Obama said. “I’ll always be grateful for that.”

The president also noted that when Osama bin Laden was killed last spring, the first person he called with the news was Bush. “I made it clear that our success was due to many people in many organizations working together over many years,” Obama said.

Bush, clearly relishing his return to his old digs, delighted the crowd with an open-mike array of one-liners. He joked that he was glad that Obama, when pondering big decisions, would be able to gaze at the large portrait in the golden frame and ask himself, “What would George do?”

That’s a question that Obama has posed, obliquely, as he has ramped up his campaign — and the answer is never good.

During a rally in Des Moines last week, Obama told supporters that his predecessor had “run up the tab” on the national debt and stuck his administration with the bill.

Democratic political strategists called Obama’s approach inherently risky, noting that voters will have little patience for blaming today’s problems on decisions made at least four years ago. At the same time, those strategists said, Obama probably has no choice but to remind voters how far the nation’s economy had tumbled.

“It’s dangerous, but it’s something you have to do,” said Steve Jarding, a Democratic consultant. “He inherited a complete mess, and it behooves him to remind the American public, ‘Wait, here’s the progress I’ve made.’ ”

There is some evidence that Obama’s strategy has paid dividends. A Washington Post-ABC News poll in May found that 49 percent of respondents blamed Bush for the nation’s current economic woes, with 34 percent blaming Obama. Eight percent blamed them equally.