The announcement came on a violent day in Iraq, where police said a double-bombing in eastern Baghdad targeting traffic police left at least 18 people dead and 52 others wounded.
"We have agreed today that the mission will end no later than 31st May," Brown said at a news conference with Prime Minister Nouri al-Maliki.
The news conference took place without disruption, in contrast to one on Sunday with President George W. Bush, when an Iraqi journalist hurled both his shoes at Bush. The journalist, Muntadhar al-Zeidi, appeared before a judge Wednesday in his jail cell.
"We thank (British troops) for the efforts they have made for getting rid of dictatorship and terrorism. They have made a lot of sacrifices," al-Maliki said.
Britain's defense ministry said U.S. troops will take over Britain's base next to Basra's airport once U.K. forces leave.
A spokesman for the ministry, who spoke on condition of anonymity, said U.S. commanders judged they needed to deploy troops to the region to secure supply lines which pass through southern Iraq from Kuwait.
"The U.S. will take over our base, but they're not replacing British soldiers - they'll perform a different task," said the spokesman.
Unlike the U.S., Britain has no plans to shift large numbers of troops from Iraq to Afghanistan. Brown has said other NATO allies must play a greater role.
Brown also said he and al-Maliki discussed the fate of five Britons who were kidnapped by a Shiite militia a year and a half ago.
The men - information technology consultant Peter Moore and four guards - were seized from the Iraqi Finance Ministry compound in Baghdad in a brazen raid in May 29, 2007.
Little information on them has come since, although a British newspaper reported this summer that the militia said one of the hostages had committed suicide.
"I call for all those who are holding them to let them return to their families immediately and without condition," Brown said.
Britain's withdrawal plans come amid a general improvement of security in Iraq. But severe problems remain, underlined by Wednesday's double bombing.
An Iraqi police official says the first blast Wednesday morning was from a car bomb. Moments later, a roadside bomb went off nearby targeting people rushing to the scene.
The official spoke on condition of anonymity because he was not authorized to speak to the news media.
The U.S. military says a roadside bomb exploded near an American patrol hours earlier in the same area but that there were no deaths or injuries.
---
Associated Press writer David Stringer contributed to this report from London.