BAGHDAD — There are only 20 American military bases left in Iraq ahead of a year-end US withdrawal, down from a peak of 505, government spokesman Ali al-Dabbagh said in a statement on Monday.

There are "only 20 US bases that remain to be evacuated, while US forces are continuing their evacuation and withdrawing all their soldiers and equipment, and are handing over those bases and sites to the Iraqi government according to the signed agreement between the two sides," Dabbagh said.

He was referring to a 2008 security agreement between Baghdad and Washington that calls for all US troops to leave the country by the end of 2011.

Dabbagh added that 485 bases and military sites have been handed over to Iraqi forces, from a peak figure of 505 in 2008.

The roughly 39,000 US soldiers remaining in Iraq must leave by year-end, unless Baghdad and Washington reach an agreement on a post-2011 US military training mission.

Talks are stalled over the issue of immunity from Iraqi prosecution for military trainers -- the US insists that any soldiers remaining here must have it, while Iraqi leaders say such protection is unnecessary.