Updated

President Obama's Oval Office address Tuesday evening was timed to mark the end of the U.S. combat mission in Iraq, though it also came two months before midterm congressional elections that could hinge on the state of the domestic economy -- and Obama didn't shy from drawing links and contrasts between the two.

Obama portrayed the end of the U.S. combat role in the Iraq as an opportunity to shift more focus to rebuilding the economy, which some economists say is increasingly in danger of falling back into a recession.

"We have spent a trillion dollars at war, often financed by borrowing from overseas. This, in turn, has short-changed investments in our own people, and contributed to record deficits," he said, adding that too many middle-class families are working harder for less.

The troops in Iraq "have met every test that they faced," Obama said. "Now, it is our turn. Now, it is our responsibility to honor them by coming together, all of us, and working to secure the dream that so many generations have fought for -- the dream that a better life awaits anyone who is willing to work for it and reach for it".

But Republicans refused to allow Obama to move on without noting the credit they say was due to President Bush for the troop surge in 2007 that ultimately saved a losing war effort. Although Obama had opposed the surge as a senator, Republican leaders said he should have given Bush kudos for its success.

More On This...

John McCain, the Republican senator who ran against Obama in the 2008 presidential election, called it "a real lack of generosity of spirit."

"What he should have said: 'I opposed the surge. I was wrong. I made a mistake and George W. Bush deserves credit for doing something that was very unpopular at the time,'" McCain told Fox News. "Instead he had to say it's well known that George Bush loves the troops."

Obama saluted Bush's commitment to U.S. troops and U.S. security. And he cited the surge in Iraq in the same breath as his own troop buildup in Afghanistan, though he parted from Bush's reluctance to set a timetable. Obama repeates his call for a July 2011 drawdown of U.S. forces in Afghanistan.

Sen. John Cornyn, R-Texas said Obama "is right to honor our troops who helped turn the tide of violence in Iraq during its darkest days."

"But it's puzzling to listen to this White House try to take credit for the results of the strategy he and Vice President Biden adamantly opposed from the start," Cornyn said in a written statement.

"Our success in Iraq has everything to do with the hard work of our men and women in uniform, the Iraqi people, and President Bush's resolve. It has nothing to do with President Obama's campaign promise to carry out the previous administration's plan for returning US troops from Iraq."

Some Democrats, meanwhile, joined Obama in seizing the opportunity to pivot to economic issues.

"The cost of our military operation in Iraq -- more than $700 billion to date -- continues to plunge us deeper into debt," Sen. Russ Feindgold of Wisconsin said in a written statement. "We can help get our fiscal house in order by ending our military involvement in Iraq. Delaying our final troop redeployments for another year will add tens of billions more dollars to our massive debt."