BAGHDAD Prime Minister Gordon Brown announced the end of Britain's involvement in the Iraq war on Wednesday, saying almost all its troops would be out by the end of July next year.
Brown's fourth trip to Iraq as prime minister coincided with the drafting by the Iraqi government of a law that obliges British forces to withdraw in mid-2009, more than six years after the U.S.-led invasion.
His trip was not announced in advance, for security reasons, and followed a visit on Sunday by U.S. President George W. Bush, who had to dodge shoes thrown by an Iraqi journalist angry at the sectarian slaughter unleashed by the invasion.
Shortly after Brown met Prime Minister Nuri al-Maliki, twin bomb blasts in Baghdad killed 18 people and wounded 53, in a reminder of the violence that has only recently begun to wane.
"The role played by the UK combat forces is drawing to a close. These forces will have completed their tasks in the first half of 2009 and will then leave Iraq," Brown and Maliki said in a joint statement.
"But the partnership between the two countries will continue to take on new dimensions."
Britain, Iraq's former colonial power, was the United States' main partner in the war. Its forces have shrunk to just 4,100 soldiers now based near the southern city of Basra, where Brown headed after a brief visit to Baghdad.
Britain says its work in the south of Iraq is done and that Basra is now safely in the hands of Iraqi security forces.
"They've done some of the most difficult work ... building a democracy for the future and defending it against terrorism," Brown said of the 100,000 British soldiers he estimated had served in Iraq since 2003.
"I said we would stay until we'd finished the job we set out to do. The tasks that we set out to do have been done and that's why we can take a decision to bring most of our forces home," he said later, just before leaving Iraq.
People questioned in Basra, which controls most of Iraq's oil exports, seemed unlikely to miss Britain's presence.
"I do not think the British forces brought any benefit to Basra, not before and not now," said Muntazer Jabar, 55, a retired military officer who runs a supermarket.
"There's no need for them to delay their withdrawal. It'd be better for them and for us if they withdraw now."
The withdrawal could help Britain focus on Afghanistan, where the Taliban and other groups are stepping up attacks.
Britain has said it will transfer helicopters from Iraq to Afghanistan, giving its 8,300 troops there greater mobility, but there are no plans to increase troop numbers.
British defense sources say it has become almost impossible to sustain military operations in two theatres.
The law setting out terms for the British withdrawal also covers the remaining Australian, Estonian, Romanian, Salvadoran and NATO troops, and needs the approval of the Iraqi parliament.
It sets the end of May as the final date for combat operations and end-July as the withdrawal date.
The draft law is akin to a "status of forces" agreement with the United States which was approved by Iraq's parliament after fierce debate. The U.S. security pact allows the 140,000 U.S. forces in Iraq to remain until the end of 2011.
Britain once had 45,000 troops in Iraq, but the government's support for the U.S.-led war was opposed by many people at home.
(Additional reporting by Arif Mohammed in Basra; editing by Michael Christie and Andrew Roche)