British and American troops are working alongside Iraqi forces
Securing an agreement within the next few weeks to let British troops continue in Iraq is "critical", a Foreign Office minister has said.
Bill Rammell said it was important to show the troops were there through the wishes of Iraq rather than the UN.
But the UK will have to renew a UN mandate on its military presence unless an agreement can be reached with Iraq.
Iraqi Prime Minister Nouri al-Maliki said on Monday that UK troops were no longer needed to maintain security.
There are fears the mandate, which runs out at the end of the year, could be opposed at the UN Security Council by countries who were against the war in Iraq.
Mr Rammell told BBC Radio 4's Today programme: "We certainly do want to secure a Status of Forces Agreement for our troops when the UN mandate runs out at the end of this year.
"The Americans are currently in detailed discussions. As that concludes, as I hope it will very shortly, we will then secure our own arrangements."
He added: "I think that will be very important because it will be a further demonstration that actually the troops are no longer here at the behest of the UN.
"It is an explicit agreement that's been negotiated and agreed with the Iraqi government and a further indication that the Iraqis are transforming their situation and becoming a more mature democracy and government."
Mr Rammell said it was important to resolve the issue "in the next few days and weeks".
Failure to do so would send out an "unfortunate message" about Iraq's progress towards normality, he added.
Mr al-Maliki told the Times that a "page had been turned" in his country's relationship with the UK.
However, he conceded there might still be a need for British troops' experience in training Iraqi forces.
Mr Rammell said: "Prime Minister Maliki is acknowledging the shift that has taken place over the last year where we have moved from a combat role to one that is much more based on training and mentoring."