British troops officially ended combat operations in southern Iraq today, handing over control of their base in Basra to US forces.
The last British army patrol around Iraq's second city returned to the base and a defence official confirmed: "The role of British ground forces is finished."
Britain's combat role - including patrolling the city of Basra - was originally due to end on 31 July but was brought forward as the prime minister, Gordon Brown, said Britain and Iraq had begun a "long-term partnership of equals".
Speaking after talks in Downing Street with his Iraqi counterpart, Nouri al-Maliki, Brown said: "Today marks the closing chapter of the combat mission in Iraq. The flag of 20 Armoured Brigade will be lowered as British combat patrols in Basra come to an end and our armed forces prepare to draw down."
The prime minister paid tribute to the British servicemen and women who had lost their lives in Iraq, saying the UK owed them a "huge debt of gratitude".
"Today Iraq is a success story. We owe much of that to the efforts of British troops. Our mission has not always been an easy one, many have said that we would fail," he said. "Britain can be proud of our legacy that we leave there."
Today's announcement comes as the defence secretary, John Hutton, attended a service in Basra to honour the 179 British personnel killed during the six-year conflict in Iraq.
The names of the British, Italian, Dutch, Danish, American and Romanian troops and the civilian contractors killed since 2003, were read out at the memorial wall in front of the 20th Armoured Brigade headquarters.
In London, Maliki said his country needed investment from Britain and cooperation across many fronts, including science, the economy and business.
Maliki and the oil minister, Hussain al-Shahristani, will use the visit to try to cash in on the country's improved security situation when they meet representatives of about 250 companies - including Shell and Rolls-Royce - to discuss opportunities for trade and investment.
Brown said: "We hope to sign an agreement with the Iraqi government about the future role that we can play in training and in protecting the oil supplies of Iraq."
The bulk of the 4,000 or so UK troops will have returned home by 31 May, leaving a residual number to clear up and pack whatever equipment the army wants to bring home or send to Afghanistan.
About 300 Royal Navy and Royal Marine personnel will continue to train Iraqi naval forces at the port of Umm Qasr. But the British army has now finished its task of training two Iraqi divisions - the 10th and the 14th.
The handover of the Basra airport base to the US is more than symbolic, analysts say. It is a reminder that the UK's ability to conduct military operations on its own is limited. It was the US and the Iraqis who cleared the streets of Basra from radical Shia militia in the operation called Charge of the Knights last year.
Iraqi officials say they appreciate the work done by the British in Basra over the past six years, though the city is still in need of basic services, such as clean water and a regular supply of electricity.
Maliki is later due to attend the one-day Iraq Invest conference, being held by the Iraqi government's national investment commission with the support of the UK Department for International Development. The first such event to be held in London since the 1990s, it will be addressed by the business secretary, Lord Mandelson, and the international development secretary, Douglas Alexander.