Barack Obama declared today that he is on the brink of fulfilling a campaign promise to end US combat operations in Iraq – seven years after his predecessor's triumphalist pronouncement that the war was won and the mission accomplished.

But the president warned that the plan to turn over military responsibility to the Iraqi government by the end of this month would not mean an end to the conflict or to US casualties in what he once called a "dumb war".

Amid increasing doubts over the growing war in Afghanistan, Obama sought to shift attention to what the administration is heralding as the success of its strategy to pull troops away from the frontline in Iraq.

"As a candidate for president, I pledged to bring the war in Iraq to a responsible end. Shortly after taking office, I announced our new strategy for Iraq and for a transition to full Iraqi responsibility. I made it clear that by August 31, America's combat mission in Iraq would end. And that is exactly what we are doing – as promised and on schedule," Obama told the Disabled American Veterans convention in Atlanta.

"Already, we have closed or turned over to Iraq hundreds of bases. We're moving out millions of pieces of equipment in one of the largest logistics operations that we've seen in decades. By the end of this month, we'll have brought more than 90,000 of our troops home from Iraq since I took office – more than 90,000 have come home."

Obama said that, as agreed with the Iraqi government, the US would maintain a transitional force of about 50,000 troops until the military withdrawal is completed at the end of next year.

"During this period, our forces will have a focused mission: supporting and training Iraqi forces, partnering with Iraqis in counter-terrorism missions, and protecting our civilian and military efforts. These are dangerous tasks. There are still those with bombs and bullets who will try to stop Iraq's progress, and the hard truth is we have not seen the end of American sacrifice in Iraq," he said.

"But make no mistake, our commitment in Iraq is changing – from a military effort led by our troops to a civilian effort led by our diplomats. And as we mark the end of America's combat mission in Iraq, a grateful America must pay tribute to all who served there."

The president did not declare victory but he did say that the violence in Iraq, which has claimed more than 3,400 US lives in combat and caused tens of thousands of Iraqi deaths, was now at one of its lowest points since the 2003 invasion.

Obama, who opposed the invasion, acknowledged that there were genuine differences over the war but, in contrast to the Vietnam conflict, he noted that popular support for the more than 1 million troops who served in Iraq had not wavered. He praised the troops but took what appeared to be a pointed dig at some members of George Bush's administration.

"While our country has sometimes been divided, they have fought together as one. While other individuals and institutions have shirked responsibility, they have welcomed it. And while it is easy to be daunted by overwhelming challenges, the generation that has served in Iraq has overcome every test before them," he said.

Obama is now facing a more difficult test than Iraq: American casualties in Afghanistan last month surged to their highest levels in what is now the longest conflict in US history. The president, already battered by having to fire General Stanley McChrystal, is grappling with growing doubts about the conduct of the war which have been compounded by the revelations exposed in the 90,000 pages of secret military documents released by WikiLeaks.

Obama, who has tripled the number of US troops in Afghanistan since he took office, acknowledged that "the effort in Afghanistan has been long and has been difficult", but said he remained committed to fighting the Taliban and al-Qaida.

"We will continue to face huge challenges in Afghanistan," he said. "But it's important that the American people know that we are making progress and we are focused on goals that are clear and achievable."

The president's strategy is to start bringing some of the troops home in a year, but he said he would not permit terrorists to once more gain a foothold in Afghanistan from which to attack the US. "As president of the United States I refuse to let that happen," he said.