Updated

The U.S. is abandoning plans to keep troops in Iraq past a year-end withdrawal deadline, according to The Associated Press, but Obama administration officials insist to Fox News that discussions with Iraqi leaders are "ongoing."

For months, U.S. officials have been debating whether to stick to a Dec. 31 withdrawal deadline that was set in 2008 or negotiate a new security agreement to ensure that gains made and more than 4,400 American military lives lost since March 2003 do not go to waste.

In recent weeks, Washington has been discussing with Iraqi leaders the possibility of several thousand American troops remaining to continue training Iraqi security forces.

But a senior Obama administration official in Washington told The Associated Press Saturday that all American troops will leave Iraq except for about 160 active-duty soldiers attached to the U.S. Embassy.

A senior U.S. military official confirmed to the Associated Press the departure and said the withdrawal could allow future but limited U.S. military training missions in Iraq if requested.

Both officials spoke on condition of anonymity because of the sensitivity of the issue.

But George Little, a spokesman for the Pentagon, told Fox News "suggestions that a final decision has been reached about our training relationship with the Iraqi government are wrong. Those discussions are ongoing."

White House spokesman Tommy Vietor said, "President Obama has repeatedly made it clear that we are committed to keeping our agreement with the Iraqi government to remove all of our troops by the end of this year. At the same time we're building a comprehensive partnership with Iraq under the Strategic Framework Agreement including a robust security relationship, and discussion with the Iraqis about the nature of that relationship are ongoing."

Throughout the discussions, Iraqi leaders have adamantly refused to give U.S. troops immunity from prosecution in Iraqi courts, and the Americans have refused to stay without it. Iraq's leadership has been split on whether it wanted American forces to stay.

Some argued the further training and U.S. help was vital, particularly to protect Iraq's airspace and gather security intelligence. But others have deeply opposed any American troop presence, including Shiite militiamen who have threatened attacks on any American forces who remain.

Prime Minister Nouri al-Maliki has told U.S. military officials that he does not have the votes in parliament to provide immunity to the American trainers, the U.S. military official said.

A western diplomatic official in Iraq said al-Maliki told international diplomats he will not bring the immunity issue to parliament because lawmakers will not approve it.

Iraqi lawmakers excel at last-minute agreements. But with little wiggle room on the immunity issue and the U.S. military needing to move equipment out as soon as possible, a last-minute change between now and December 31 seems almost out of the question.

Regardless of whether U.S. troops stay or not, there will be a massive American diplomatic presence.

The U.S. Embassy in Baghdad is the largest in the world, and the State Department will have offices in Basra, Irbil and Kirkuk as well as other locations around the country where contractors will train Iraqi forces on U.S. military equipment they're purchasing.

About 5,000 security contractors and personnel will be tasked with helping protect American diplomats and facilities around the country, the State Department has said.

The U.S. Embassy will still have a handful of U.S. Marines for protection and 157 U.S. military personnel in charge of facilitating weapons sales to Iraq. Those are standard functions at most American embassies around the world and would be considered part of the regular embassy staff.

When the 2008 agreement requiring all U.S. forces leave Iraq was passed, many U.S. officials assumed it would inevitably be renegotiated so that American forces could stay longer.

The U.S. said repeatedly this year it would entertain an offer from the Iraqis to have a small force stay behind, and the Iraqis said they would like American military help. But as the year wore on and the number of American troops that Washington was suggesting could stay behind dropped, it became increasingly clear that a U.S. troop presence was not a sure thing.

The issue of legal protection for the Americans was the deal-breaker.

Iraqis are still angry over incidents such as the Abu Ghraib prison scandal or Haditha, when U.S. troops killed Iraqi civilians in Anbar province, and want American troops subject to Iraqi law.

American commanders don't want to risk having their forces end up in an Iraqi courtroom if they're forced to defend themselves in a still-hostile environment.

It is highly unlikely that Iraqi lawmakers would have the time to approve a U.S. troop deal even if they wanted to. The parliament is in recess on its Hajj break until Nov. 20, leaving just a few weeks for legislative action before the end of year deadline.

Going down to zero by the end of this year would allow both al-Maliki and Obama to claim victory. Obama will have fulfilled a key campaign promise to end the war and al-Maliki will have ended the American presence in Iraq and restored Iraqi sovereignty.

The Associated Press contributed to this report.