WASHINGTON - (AP) - President Barack Obama on Friday declared anend to the Iraq war, one of the longest and most divisive conflictsin U.S. history, announcing that all American troops would bewithdrawn from the country by year's end.

Obama's statement put an end to months of wrangling over whetherthe U.S. would maintain a force in Iraq beyond 2011. He nevermentioned the tense and ultimately fruitless negotiations with Iraqover whether to keep several thousand U.S. forces in Iraq as atraining force and a hedge against meddling from Iran or otheroutside forces.

Instead, Obama spoke of a promise kept, a new day for aself-reliant Iraq and a focus on building up the economy at home. "I can report that, as promised, the rest of our troops in Iraqwill come home by the end of the year," Obama said. "After nearlynine years, America's war in Iraq will be over."

Obama spoke after a private video conference with Iraqi PrimeMinister Nouri al-Maliki, and he offered assurances that the twoleaders agreed on the decision.

The U.S. military presence in Iraq stands at just under 40,000.All U.S. troops are to exit the country in accordance with a dealstruck between the countries in 2008 when George W. Bush waspresident.

Obama, an opponent of the war from the start, took office andaccelerated the end of the conflict. In August 2010, he declaredthe U.S. combat mission over.

"Over the next two months our troops in Iraq, tens of thousandsof them, will pack up their gear and board convoys for the journeyhome," Obama said. "The last American soldier will cross theborder out of Iraq with their heads held high, proud of theirsuccess and knowing that the American people stand united in oursupport for our troops."

More than 4,400 American military members have been killed sincethe U.S. and its allies invaded Iraq in March 2003.