The U.S. military formally ends combat operations in Iraq on Tuesday as President Barack Obama seeks to fulfil a promise to end the war despite persistent instability and attacks that kill dozens at a time.

U.S. troop numbers were cut to 50,000 in advance of the August 31 milestone in the 7-1/2-year-old war launched by Obama's predecessor, George W. Bush, whose stated aim was to destroy Iraqi weapons of mass destruction. No such weapons was found.

The six remaining U.S. military brigades will turn their focus to training and advising Iraqi police and troops as Iraq takes on responsibility for its own destiny ahead of a full withdrawal of U.S. forces by the end of next year.

The story is not about 50,000. The story is that we are continuing to be committed to Iraq, but our commitment is going to change, the outgoing U.S. military commander in Iraq, General Raymond Odierno, said last week.

It's no longer one that is focussed solely on a military commitment. We are building a different relationship with Iraq, one that's focussed on economic development, one that's focussed on technological development, one that's focussed on political development and cultural development.

Obama promised war-weary U.S. voters he would extricate the United States from the Iraq war. Almost 1 trillion dollars have been spent, and more than 4,400 U.S. soldiers and over 100,000 Iraqi civilians killed since the 2003 invasion.

Obama's Democratic party is battling to retain control of Congress in elections in November. Vice President Joe Biden flew into Baghdad on Monday.

Despite Tuesday's largely symbolic deadline for combat operations to end, the 50,000 U.S. soldiers staying on in Iraq for another 16 months are a formidable and heavily armed force.

Iraqi security forces have already been taking the lead since a bilateral security pact came into force in 2009. U.S. soldiers pulled out of Iraqi towns and cities in June last year.

Nevertheless, many Iraqis are apprehensive as U.S. military might is scaled down.

The animosity that led to carnage between majority Shi'ites and minority Sunnis who dominated Iraq under overthrown dictator Saddam Hussein has not healed, and a potentially explosive conflict between Arabs and Kurds has not been resolved.

More than 1.5 million Iraqis are still displaced after being driven from their homes by violence. Many live in squalor.

Iraq's leaders have been unable to form a new government almost six months after an election that many had hoped would chart a path towards stability at a time when deals to develop the country's vast oilfields held the promise of prosperity.

Instead, the ballot could widen ethnic and sectarian rifts if a Sunni-backed cross-sectarian alliance that won the single biggest bloc in the new 325-seat parliament is excluded from power by the major Shi'ite-led political factions.

Suspected Sunni Islamist insurgents linked to al Qaeda have tried to exploit the political vacuum and declining U.S. troop numbers with persistent suicide bombings and assassinations.

The number of civilians killed in July almost doubled from the month before to 396.

The insurgents have targeted domestic security forces in particular, killing 57 at an army recruitment centre on August 17 and more than 60 when suicide car bombers attacked police stations around the country on August 25.

Saddam's once-feared armed forces were disbanded on U.S. orders after the invasion and the army, police, navy and air force had to be rebuilt from scratch. Public trust in them is low.

Iraqis fear that Shi'ite Iran, whose influence has already grown apace since Saddam's fall, will seek to fill any vacuum left by the U.S. military, in competition with Sunni-led neighbours such as Turkey and Saudi Arabia.

This is still a tough neighbourhood, it's still a country with extraordinary problems, but it's also a country that's made a great deal of progress, the newly arrived U.S. ambassador to Iraq, James Jeffrey, said.

Violence, uncertainty and risks to our strategy are not over. The potential for violence, for what I would characterise now primarily as terrorist acts here, is quite significant and the ability of terrorist acts to have an impact on political life in this country is still a significant risk.

(Editing by Alistair Lyon)