US president delivers on key election promise and thanks troops for 'job well done' – but cautions against triumphalism

Barack Obama formally brought an end to US combat operations in Iraq last night, seven years and 165 days after the invasion began, and declared it was time for America "to turn the page".

In a televised address to the nation from the Oval Office, the president said America had paid a huge price for the war begun by George W Bush to topple Saddam Hussein.

"Tonight, I am announcing that the American combat mission in Iraq has ended. Operation Iraqi Freedom is over, and the Iraqi people now have lead responsibility for the security of their country," he said.

Iraqi prime minister Nouri al-Maliki hailed the restoration of sovereignty to Iraq: "Iraq today is sovereign and independent. With the execution of the troop pullout, our relations with the United States have entered a new stage between two equal, sovereign countries."

A ceremony is to be held in Baghdad today, attended by the US vice-president, Joe Biden, and Maliki, to mark the handover of responsibility for military operations from the US to Iraqi forces. Obama, whose early opposition to the invasion helped propel his White House candidacy, presented last night as the near-fulfilment of a key 2008 presidential election campaign pledge to end the war.

"This was my pledge to the American people as a candidate for this office. Last February, I announced a plan that would bring our combat brigades out of Iraq, while redoubling our efforts to strengthen Iraq's security forces and support its government and people. That is what we have done," he said.

The number of US troops in Iraq has dropped from a high of 170,000 in 2007 to 50,000, whose mission changes from today from combat to assisting the Iraqi army. All 50,000 are scheduled to leave by the end of next year, unless the Iraqi government requests a few hundred or few thousand remain behind.

Around 1.5 million US men and women served in a war the Pentagon in 2003 had promised Bush would be short. There were 4,400 US fatalities, and an Iraqi death toll estimated at 100,000 to several hundreds of thousands. The US had 3.4m pieces of equipment in Iraq last year. That is down to 1.2m now, with bases reduced from 357 to 94.

It was only the second time that Obama has delivered a televised address from the Oval Office, the first when he promised to deal with the BP oil spill in the Gulf.

Obama said last night: "From this desk, seven and a half years ago, President Bush announced the beginning of military operations in Iraq. Much has changed since that night. A war to disarm a state became a fight against an insurgency. Terrorism and sectarian warfare threatened to tear Iraq apart. Thousands of Americans gave their lives; tens of thousands have been wounded. Our relations abroad were strained. Our unity at home was tested."

Obama engaged in a balancing act, wanting to boast that he had met his campaign promise but also stopping well short of a declaration of victory, especially with violence continuing in Iraq and the failure of Iraqi politicians to create a coalition government six months after elections.

He was careful to avoid the premature triumphalism that came to haunt George W Bush, whose "mission accomplished" banner in May 2003, only weeks after the invasion, was often replayed at each fresh outbreak of violence. Obama spoke to Bush by phone yesterday but the White House refused to say what they discussed.

During his address Obama noted that he and Bush had been at odds over the war. In a half-hearted effort at unity, he said no one doubted Bush had been committed to US troops and national security but he refused to go as far as Republicans wanted him by giving him credit for the 'surge'.

Republican leaders had claimed yesterday the handover of power was a success not for Obama but for Bush and his "surge" strategy in 2007, boosting the number of US troops, and reminding the public that Obama had been opposed to that strategy.

The Republican leader in the House, John Boehner, took aim at Obama, saying: "Some leaders who opposed, criticised, and fought tooth and nail to stop the surge strategy now proudly claim credit for the results. Today we mark not the defeat those voices anticipated, but progress," he told an American Legion convention in Milwaukee.

Last night the president concentrated on praising US troops, and expressing a desire to look beyond Iraq to other issues, namely Afghanistan and the pressing economic problems facing the US.

"Ending this war is not only in Iraq's interest – it is in our own. The US has paid a huge price to put the future of Iraq in the hands of its people. We have sent our young men and women to make enormous sacrifices in Iraq, and spent vast resources abroad at a time of tight budgets at home ... Now, it is time to turn the page."

He warned that it would be a misinterpretation if anyone saw the US withdrawal as a move towards isolationism. Instead, he said America "intends to sustain and strengthen our leadership in this young century".

Like others in the Obama administration, the defence secretary, Robert Gates, who held the post under Bush too, cautioned against "premature victory parades or self-congratulations".

Noting the failure of the Iraqis to form a government and the continued violence, he said: "I am not saying that all is, or necessarily will be, well in Iraq."