US President Barack Obama has met Iraqi Prime Minister Nuri al-Maliki, in an event to mark the US exit from a war launched to oust Saddam Hussein but which left a wounding legacy for both nations.

Mr Obama held talks with Mr Maliki at the White House as the last US troops of a garrison that once numbered nearly 170,000 prepare to leave.

Although most US troops will leave Iraq, hundreds of private contractors and US military trainers will remain.

Tens of thousands of Iraqis died in the war as well as the insurgency and sectarian violence that followed.

NATO will end its seven-year troop training mission in Iraq at the end of December, a move that will coincide with the withdrawal of US troops from the country.

The decision follows Mr Obama's announcement in October that troops would go home at the end of December.

A statement from NATO Secretary-General Anders Fogh Rasmussen said the decision to end the NATO mission launched in 2004 was taken at a meeting of alliance ambassadors in Brussels.

A NATO official said the talks with Iraq ground to a halt over the same issue of jurisdiction.

He said NATO's mission to help develop a more sustainable, multi-ethnic security force had trained more than 5,000 military and 10,000 police personnel in Iraq over the past seven years.

NATO also provided courses for nearly 2,000 Iraqi staff in NATO countries and more than 115 million euros' worth of military equipment and €17.7m in trust fund donations for training and education at NATO facilities.