The series of events, starting with a speech here to a veterans’ group, puts the president in the thick of a volatile national security debate at a critical moment for both wars as he draws down troops from one theater and sends more to the other. While seeking to shore up domestic support, he is also defining the limits of his ambitions in both Iraq and Afghanistan.

Mr. Obama vowed to complete his plan to withdraw designated combat forces from Iraq by the end of August “as promised and on schedule,” even though a political impasse has left Baghdad without the permanent government that his strategy originally envisioned. At the same time, he vowed to destroy Al Qaeda in Afghanistan while sticking to “clear and achievable” goals rather than aspiring to build a fully functioning democracy.

The president’s renewed public focus on the wars comes after many months in which his domestic agenda was at the center of the national conversation. But the White House calculated that the drawdown in Iraq and the change in mission there this month provided an opportunity to take credit for fulfilling one of Mr. Obama’s central campaign promises even as war fatigue takes its toll.

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

The drawdown will bring the American force in Iraq to 50,000 troops by Aug. 31, down from 144,000 when Mr. Obama took office. The remaining “advise and assist” brigades will officially focus on supporting and training Iraqi security forces, protecting American personnel and facilities, and mounting counterterrorism operations.

The mission’s name will change from Operation Iraqi Freedom to Operation New Dawn, and the 50,000 transitional troops will leave by the end of 2011, according to an agreement negotiated by President George W. Bush and reaffirmed by Mr. Obama. And addressing the concerns of veterans, Mr. Obama vowed that “your country is going to take care of you when you come home.”

While not the end of the conflict — at least nine people were killed on Monday in attacks around Iraq — the transition this month represents a significant milestone after seven years of war that toppled a brutal dictator, touched off waves of sectarian strife and claimed the lives of more than 4,400 American soldiers and tens of thousands of Iraqis.

In his speech here, Mr. Obama hailed the improved security in Iraq without mentioning that he had opposed the 2007 troop buildup ordered by Mr. Bush, which along with a strategy change, is credited by many with turning the war around. Mr. Obama has now assigned the architect of that plan, Gen. David H. Petraeus, to do the same in Afghanistan.

Republicans were happy to remind Mr. Obama of his opposition to the Iraq buildup, circulating his quotations from the time. “It’s worth remembering that prior to the full deployment of this force, some Democrats were already declaring the surge the president is referring to today a complete failure,” said Senator Mitch McConnell of Kentucky, the Republican leader.

Nonetheless, Mr. Obama has adopted Iraq as a relative success story, and aides said he and other administration officials would hold several events in August to honor returning soldiers and promote the drawdown. The notion that Iraq would be the political selling point while the “good war” in Afghanistan is now the sour note underscores how much has changed since Mr. Obama began his presidential campaign.

Christopher Gelpi, a political science professor at Duke University, said Mr. Obama’s challenge is convincing Americans that Afghanistan is a worthy cause even if Iraq was not. “You may argue this is a good war, but they don’t have any information about it,” he said. “But they do know about the Iraq war and they’re using that as a lens to interpret Afghanistan. This creates a big problem for Obama because his core constituents view Iraq negatively.”

The conundrum is that his buildup in Afghanistan is supported more strongly by Republicans than by his own party. In the House, 102 Democrats voted against a war spending measure last week, 70 more than a year ago. As a former national security official, who requested anonymity to avoid offending the White House, put it: “The people who love him don’t support him on Afghanistan, and the people who support him on Afghanistan hate him.”

Moreover, the skepticism on Afghanistan comes at a time when Mr. Obama is weakened politically. His standing in Georgia is low enough, for example, that former Gov. Roy Barnes, running to reclaim his old office, chose to skip a Democratic fund-raiser starring the president after his speech to the veterans.

The White House used the occasion to argue that Mr. Obama is broadly reducing the American military presence abroad. A White House fact sheet noted that even with the buildup in Afghanistan, the drawdown in Iraq means the total number of uniformed Americans in the two countries will drop to 146,000 by September, down from 177,000 when he took office.

The president also argued the importance of succeeding in Afghanistan, reminding Americans that it was the home of Al Qaeda when it plotted the attacks of Sept. 11, 2001. “If Afghanistan were to be engulfed by an even wider insurgency, Al Qaeda and its terrorist affiliates would have even more space to plan their next attack,” he said. “And as president of the United States, I refuse to let that happen.”

But in making his goal the destruction of Al Qaeda, which American intelligence believes has only about 100 members in Afghanistan, Mr. Obama underscored the limits of his commitment.

And he made clear it was not open-ended: “It’s important that the American people know that we are making progress,” he said, “and we are focused on goals that are clear and achievable.”