Addressing soldiers at Fort Bragg, North Carolina, home of the 82nd Airborne Division, Obama said he wanted to mark "a historic moment in the life of our country and our military".
"As your commander in chief and on behalf of a grateful nation, I'm proud to finally say these two words - welcome home, welcome home, welcome home," he told thousands of troops gathered in an airplane hangar, who erupted in cheers.
The war killed 4 500 US troops and at least 60 000 Iraqis. Obama said on Tuesday the war would cost more than $1 trillion all told.
Ending the Iraq war fulfils a promise that helped Obama win the presidency in 2008 and allows the White House to focus more on Afghanistan as well as economic worries at home, where the high jobless rate is a major concern for voters.
But as the last American forces pack up and leave Iraq this month, the debate over Obama's exit strategy remains heated.
Critics have accused Obama of ending the war hastily to suit his re-election campaign, warning the pullout could embolden still-active insurgent fighters as well as Iraq's neighbour Iran.
Mitt Romney, a leading Republican contender for the 2012 presidential race, said in an open letter to Obama on Wednesday that "words of welcome to our returning soldiers is not enough" and called it "a disgrace" that veterans of the Iraq war are facing unemployment above 11%, several points higher than the national rate.
And John McCain, who ran against Obama for the presidency in 2008, said this week he found it "a bit presumptuous" for Obama to take credit for the conflict he was opposed to and was set to respond to what he called the president's "victory lap" in Fort Bragg later on Wednesday.
As of this week, there were about 5 500 US troops left in Iraq, down from more than 170 000 at the height of the war.
Obama owes his presidency in part to his opposition to the Iraq war, which grew hugely unpopular as the Bush administration wore on and claims that Iraqi leader Saddam Hussein was hiding weapons of mass destruction and supporting al-Qaeda militants turned out to be false.
As an Illinois state legislator, Obama gave a stirring speech in 2002 warning that invading Iraq would plunge the US into a "dumb war" and he used his anti-war stance to distinguish himself in the Democratic presidential run-off from Hillary Clinton who voted in Congress to go to war in Iraq.
In office, Obama moved quickly to scale back what his aides had dubbed "Bush's war" and to shift the Pentagon's focus to Afghanistan and its border with Pakistan, which he called the neglected battleground in the fight against al-Qaeda.
Commentators now see that conflict as "Obama's war" and believe his presidency will be judged more on the outcomes of the Afghan campaign than on developments in Iraq.