The last of Britain's military forces in Iraq pulled up anchor Sunday, ending more than eight years of fighting militants and training security forces since invading in 2003.

Eighty-one Royal Navy sailors turned over the task of patrolling waters off the southern port city of Umm Qasr on the Persian Gulf to Iraq's fledgling navy. It was the last hands-on mission that British troops had in Iraq since combat forces pulled out of the southern city of Basra in July 2009.

Brig. Gen. Max Marriner, commander of British forces in Iraq, cited dramatic security gains across the country, and particularly in the south, that he said British troops helped make happen.

"Security has fundamentally improved and as a consequence, the social and economic development of the south has dramatically changed for the better, as too have people's lives," Marriner said in a statement.

He said the Iraqi Navy is ready to go the mission alone, "so now is the time for the UK to dress back and let them complete the mission they were created for."

Officials said 179 British troops died in Iraq since the 2003 invasion that ousted Saddam Hussein.

But the war has been unpopular in Britain, where a government inquiry is examining mistakes made in the build-up to and aftermath of the U.S.-led invasion.

The question of whether information making the case for war that was presented to Parliament in September 2002 was "sexed up" has been hotly debated since the invasion, as has the failure to find any evidence that Iraq had weapons of mass destruction.

A small number of British defense officials will continue to work at the embassy in Baghdad, and 44 British military personnel also will remain in Iraq as part of the NATO training mission at the Iraqi Military Academy at a base in the capital's south.

Iraqi government spokesman Ali al-Dabbagh said U.S. sailors will continue training Iraqi forces to secure waters off the nation's coast through the end of the year.