More than 200 soldiers based at Fort Bragg died over the course of the nearly nine-year war.
The final US soldiers are expected to leave Iraq within days.
The last combat troops departed in August 2010.
"Tomorrow the colours of the United States Forces Iraq, the colours you fought under, will be formally cased in a ceremony in Baghdad," Mr Obama said. "Then they'll begin their journey across an ocean back home."
AnalysisThis was a war that Barack Obama never wanted, and now he's brought it to a close.
As a senator, he had called the conflict "dumb". But as commander in chief, he has paid tribute to the sacrifices of the military.
In Fort Bragg, he told the troops their fighting and dying had not been in vain. It had led to what he said was this moment of success. They were leaving behind a country that was not perfect but Iraq was now stable, led by its own people.
There was no Mission Accomplished banner like the one unfurled by his predecessor, President George W Bush, in May 2003, before the insurgency got under way.
But this was almost a victory lap, if only because Mr Obama had promised as a presidential candidate that he would bring all the troops home, and now he has.
His critics, however, say the withdrawal is premature and will endanger Iraq's very fragile democracy.
Nearly 1.5 million Americans served in Iraq, with 30,000 wounded and nearly 4,500 dead, Mr Obama said, but "those numbers don't tell the whole story of Iraq".
It was his first visit to Fort Bragg, and he was joined by his wife Michelle, who as first lady has been an active veterans' advocate.
The troops based at Fort Bragg and elsewhere should be proud of their service, Mr Obama said, because success had not been guaranteed.
"The war in Iraq will soon belong to history, and your service belongs to the ages," he said, mentioning the "grind of insurgency", roadside bombs and sniper attacks.
He also focused on his commitment to ensuring veterans find the jobs and resources they need back home.
"You stood up for America, now America must stand up for you," Mr Obama said, adding that veterans' skills could be used to rebuild the US.
The unemployment rate for veterans serving over the past decade is 2.5% higher than the national average.
The speech was not without political significance. Mr Obama narrowly won North Carolina in the 2008 election.
'A promise kept'
Republicans have criticised him for withdrawing from an unstable Iraq, although most Americans support the withdrawal.
On Tuesday, Mr Obama was joined by Iraqi Prime Minister Nouri Maliki in Washington as he said the US would still support Iraq while the two countries move towards a more conventional relationship.
President Obama has framed the withdrawal as a promise kept from his 2008 election campaign.
During his bid for the White House, he stood as the anti-war candidate and spoke of the need to bring troops home and rebuild a troubled economy.
Mr Obama announced in October that all US troops would leave Iraq by the end of 2011.
US troop numbers in Iraq peaked at around 170,000 during the height of the so-called surge strategy in 2007.