Tony Blair today avoided a damaging defeat at the Labour conference over pulling British troops out of Iraq.
Delegates voted by 86% to 14% to reject a motion calling on the Prime Minister to set an early date for withdrawing the troops.
In a card vote they instead endorsed a statement by Labour's ruling National Executive Committee, recognising British forces would stay as long as the Iraqi government wanted them to.
Although the move will be a relief to the Labour leadership, the unions – who sided with it – said it effectively meant the Government was now signed up to a timetable to end the British presence in Iraq.
Defence Secretary Geoff Hoon said backing the troops out motion would mean abandoning the Iraqi people.
In a debate which Mr Blair listened to from the platform, Mr Hoon said it was vital for the troops to stay to help improve the lives of the Iraqi people, re–building schools and providing security.
"We must stay the course and see the job through," he said.
Foreign Secretary Jack Straw, in his address to the conference, quoted an Iraqi trade unionist in saying that "an early date for the unilateral withdrawal of troops would be bad for my country, bad for the emerging progressive forces, a terrible blow for free trade unionism, and would play into the hands of extremists and terrorists."
The NEC statement said British troops remained in Iraq "only at the request of the Iraq government". It said the UN mandate for the multinational forces would end by December 2005.
The TGWU delegation met this morning and agreed to support the statement along with Unison, Amicus and the GMB.
Unison general secretary Dave Prentis said: "Unison, working with the other unions, has got the Government to acknowledge openly, for the first time, that there is a timetable to which they must work to end the occupation of Iraq.
"The Government has accepted that the only circumstances in which troops will remain after December 2005 is if they are asked to by the UN or by a democratically elected Iraqi Government, under UN and international law."
Today's vote came after a week which, against the wishes of the leadership, was dominated by Iraq.
In his speech earlier in the week, Mr Blair urged the party to put aside its differences over the war and seize the chance for an historic third term in power.
He said he would not apologise for ousting Saddam Hussein from power while acknowledging mistakes were made in the run–up to the war.
But he appealed to delegates: "Whatever disagreements we have had, (we) should unite in our determination to stand by the Iraqi people until the job is done."
He insisted he had not intended to sideline debate on Iraq at the Brighton conference, but had always planned to tackle it head on.
On the domestic front he unveiled a ten point manifesto pledge to take his party into the next election, appealing to activists: "Let's get out and do it."
The plight of British hostage Ken Bigley has also hung heavy over the conference. Mr Blair has repeatedly insisted he was doing everything possible to secure his release.
Another key theme of the week, again against the wishes of the leadership, was the rift between Mr Blair and his Chancellor.
Labour's new election chief Alan Milburn sparked renewed speculation about their relationship after he clashed with Gordon Brown over the general election campaign.
The Chancellor told the conference he wanted his record on the economy to form the cornerstone of the campaign.
But Mr Milburn said simply "screaming louder and louder" about Labour's achievements in the past was not enough to win over cynical voters.
Mr Blair has handed Mr Milburn the role of masterminding Labour's election campaign. That is precisely the job Mr Brown has taken in the past.
But the conference was able to unite behind rock superstar Bono who called on Mr Blair and Mr Brown to use Britain's influence to transform the future of Africa.
The U2 frontman – who followed the likes of Bill Clinton and Nelson Mandela as international guest speaker – called on the two men to use Britain's presidency of the G8 and EU next year to lead an international effort to tackle the continent's poverty.