BAGHDAD (Reuters) - U.S. troops pulled out of Baghdad on Monday, triggering jubilation among Iraqis hopeful that foreign military occupation is ending six years after the invasion to depose Saddam Hussein.

Iraqi policemen take part in a ceremony transferring authority from the U.S. Army to Iraqi forces, in Basra, 420 km (261 miles) southeast of Baghdad, June 29, 2009. REUTERS/Atef Hassan

Iraqi soldiers paraded through the streets in their American-made vehicles draped with Iraqi flags and flowers, chanting, dancing and calling the pullout a “victory.”

One drove a motorcycle with party streamers on it; another, a Humvee with a garland of plastic roses on the grill.

U.S. combat troops must pull out of Iraq’s urban centers by midnight on Tuesday under a bilateral security pact that also requires all troops to leave the country by 2012.

All had left the capital by Monday afternoon, Major-General in Staff, Abboud Qanbar, head of Iraqi security forces in Baghdad, told Reuters.

Another Iraqi official who would not be named said some units in cities outside Baghdad would leave at the last minute. Pentagon spokesman Bryan Whitman said 30 bases remained to be handed over. There are still some 130,000 U.S. troops in Iraq.

Addressing military leaders in Baghdad, Prime Minister Nuri al-Maliki said: “Our sovereignty has started and ... we should move forward to build a modern state and enjoy (the) security which has been achieved.”

Many Iraqis were elated even though they feared militants might use the withdrawal as an opportunity to step up attacks.

“The American forces’ withdrawal is something awaited by every Iraqi: male, female, young and old. I consider June 30 to be like a wedding,” said Ahmed Hameed, 38, near an ice cream bar in Baghdad’s upmarket Karrada district.

“This is proof Iraqis are capable of controlling security inside Iraq,” added the recent returnee from exile in Egypt.

The government has declared June 30 a national holiday, “National Sovereignty Day.”

“BIG JOY”

A spate of bombings in recent days, including two of the deadliest for more than a year that killed 150 people between them, have raised fears militants will try to step up the pace of attacks.

Yet few Iraqis see that as reason for the Americans to stay.

“It is a big joy to see them leaving,” said Abu Hassan, 60, a shop owner. “There might be some more attacks because of struggles between the different parties, but Iraqis are controlling security now. It’s up to our forces now.”

At a ceremony outside central Baghdad’s old defense ministry building, the last Baghdad location to be handed over by U.S. forces, a military band played while soldiers and army college students paraded through a square festooned with Iraqi flags.

“Baghdad is safe, Iraq is safe. We are moving to sovereignty in secure steps,” Qanbar said at the ceremony, which unusually was not cordoned off, despite the presence of the commander of U.S. forces in Baghdad, Major-General Daniel Bolger.

U.S. troops will remain at two giant bases near Baghdad airport that are defined as non-urban, in case the Iraqis need to draw on their firepower.

“They’ll ask us for help whenever they need something but they’ve got a lot of capability. This is their country. It only makes sense they should secure their own cities,” Bolger said.

Ultimately, Iraq’s future depends not on U.S. firepower but on efforts to reconcile fractious ethnic and sectarian groups.

In an interview with Reuters on Monday, the new U.S. ambassador to Iraq Chris Hill said the U.S. did not seek a long term military presence in Iraq, contrary to the fears of some Iraqi political groups, only a long term diplomatic presence.

“But at the end of the day the Iraqis are going to have to work out the political problems themselves,” he said.

More than six years of U.S. occupation and the orgy of sectarian violence it unleashed have left most Iraqis feeling at best ambivalent about U.S. forces.

Many complain their lives have improved little since then, with daily struggles caused by power cuts and water shortages.

“They did a good job getting rid of that tyrant, Saddam, and we thank them for that, but it’s really time for them to leave,” said Talib Rasheed, 70, sitting outside in one of Baghdad’s leafier suburbs. “Maybe they could leave us some electricity?”