By Patrick Markey

BAGHDAD (Reuters) - Just weeks before U.S. troops plan to leave Iraq, the country's political elite and Washington are at odds over whether American soldiers stay as trainers: Baghdad rejects any legal immunity for U.S. soldiers and Washington says that means no deal.

Without a shift in Iraq's position, any accord will likely now fall somewhere in between as Iraq's political stalemate, U.S. domestic opposition to the war and a lack of time force a deal that leaves a just few hundred American soldiers in Iraq.

Iraqi Prime Minister Nuri al-Maliki last week said U.S. troops could stay on as part of the small NATO mission or as part of an already existing U.S. embassy military training program which would give American troops legal protections.

The country's political leadership gave Maliki the green light to negotiate, but without immunity -- a sensitive matter that would have required tricky horse-trading within his fragile cross-sectarian government and possible defeat in parliament.

But Washington sounds skittish on the options, insisting U.S. troops would need full protections or at least assurances that whatever Iraq offers would bring the same legal cover.

"I can't see the United States agreeing to blanket Iraqi jurisdiction," said Stephen Biddle at the Council on Foreign Relations. "If it is more than just brinkmanship and if they are going to insist on this, then I think the United States will decline to stay at all."

More than eight years after the U.S.-led invasion that ousted Saddam Hussein, around 41,000 troops are in Iraq mostly advising Iraqi forces since ending combat operations last year.

While violence has fallen since the sectarian slaughter in 2006-2007, Iraq still suffers daily attacks from a stubborn insurgency allied with al Qaeda and from Shi'ite militia.

In private some Iraqi leaders acknowledge they would like a U.S. troop presence as a guarantee in a country where sectarian tensions still simmer and Iraqi Arabs and Kurds are in dispute over who controls oil-rich areas in the north of Iraq.

Only anti-U.S. Shi'ite cleric Moqtada al-Sadr openly opposes a continued U.S. presence. His militia once battled U.S. troops, but he is now a key political ally for Maliki. His opposition to U.S. troops complicates the Iraqi leader's position.

Maliki says Iraq needs fewer than the 3,400 troops U.S. officials requested. But his alternatives leave little room for Washington.

The embassy's Office of Security Cooperation-Iraq or OSC-I already has trainers covered by diplomatic immunity as part of the State Department. Attaching more uniformed officers maybe the most viable option, but numbers would likely be limited.

"Under this agreement it could be just 200, or 300," said Iraqi lawmaker Sami al-Askari, a Maliki ally. "They have no option. The alternative is for them to leave altogether."

SENSITIVE ISSUE

Immunity is a sensitive issue for many Iraqis who remember abuses committed by U.S. forces and contractors during the worst years of the war. U.S. soldiers in other countries also have the kind of legal protections Washington wants in Iraq.

Under the current deal, U.S. soldiers come under U.S. jurisdiction for certain crimes committed on duty.

Bringing U.S. troops under the umbrella of the small NATO training mission in Iraq could also provide Americans with legal protections. But that option brings its own problems.

NATO has fewer than 200 staff involved in training such as police work and logistics in the mission set to end in 2013. Iraqi lawmakers are now discussing a bill to expand the NATO program and allow some U.S. troops to stay.

But that may not be enough for Washington and it could face resistance from NATO countries worried it would attract hostility against U.S. troops to the more low-key NATO operation.

"Lots of people here are likely to find that even less reassuring than if our military folks were part of the U.S. diplomatic mission," David Mack, Middle East Institute Scholar and former U.S. ambassador.

POLITICAL "DRIFT"

Iraqi and U.S. officials say Iraq's armed forces are more capable now of containing the country's stubborn insurgency. But they acknowledge their military still needs training in areas such as air defense, logistics and intelligence gathering.

Even without military trainers, hundreds of American civilian contractors will be going to Iraq to help Iraqi forces train up on hardware such as F-16 fighter jets.

Some in Washington see a strong U.S. presence in Iraq as essential for stability and as a buffer against Iran's influence. Defense hawks such as Senator John McCain say more than 10,000 U.S. troops may be needed in Iraq.

But a shift in Baghdad's position now looks difficult. Iraq's political process is already mired in squabbling among Shi'ite, Sunni and Kurdish blocs that make up the power-sharing government.

"The risk is that you are at a tipping point where we are at the withdrawal date and they will negotiate a few trainers and that is all there will be," one Western diplomat said. "No one has the political courage to grip this and it will just drift."

Still, when the United States and Iraq negotiated their 2008 security agreement, talks dragged for almost a year. Iraqi sovereignty, immunity and a date for withdrawal complicated negotiations before the final security agreement was signed.

"U.S. troops will almost certainly stay," said Gala Riani at IHS Global Insight. "But the technicalities are still important for reassuring the Iraqi public and critical parties."

$INS01; Line LNY Insave:- TI line name (Map report)