NATO leaders endorsed a plan Monday to wind down the international combat mission in Afghanistan, giving President Obama a concrete exit strategy from an unpopular war as he seeks reelection partly on his record as an effective commander in chief.

The strategy, built around the steady withdrawal of American and other foreign troops from Afghanistan through 2014, holds risks for Obama and could threaten the gains secured by U.S. forces over more than a decade of war.

It is also complicated by an unresolved dispute with Pakistan, which has refused to reopen ground routes vital to a swift departure of international forces in the months ahead. Obama acknowledged “real challenges” with the Islamabad government.

But the plan marks a clear turn for international forces into the final stretch of a war that began after the Sept. 11, 2001, attacks. Afghanistan is the second of two wars that Obama inherited on taking office, and his ability to bring it to a close as public opposition rises across party lines provides a boost to his campaign prospects.

“We leave Chicago with a clear road map,” he said at a news conference concluding the two-day summit. “This alliance is committed to bringing the war in Afghanistan to a responsible end.”

Obama spoke hours after NATO leaders agreed on a framework for gradual departure that calls for Afghan security forces to take the lead in combat operations across the country by the middle of next year, with coalition troops playing a supporting role until their pullout wraps up by the end of 2014.

Each nation will determine its own pace of withdrawal, coordinated with coalition planners. About 132,000 international troops are in Afghanistan today, two-thirds of them American.

An international military training and support mission will replace the combat operations after 2014. But the long-term presence, which will entail financial support for the Afghan National Security Forces, will cost billions of dollars a year, long after the last foreign service member leaves the country. The pledges will probably be hard to come by in what NATO officials here described as the alliance’s “age of austerity.”

The summit came at a delicate moment for the Afghanistan effort and for Obama’s plan to end the war.

But Obama departs the summit with his exit strategy validated and an end date for the U.S. involvement in the war, a political asset he can now feature even more prominently. The presumptive Republican nominee, Mitt Romney, has criticized Obama for devising a withdrawal from Afghanistan that he says is motivated by campaign politics.

“I don’t think there’s ever going to be an optimal point where we say, ‘This is all done, this is perfect, this is just the way we wanted it, and now we can wrap up all our equipment and go home,’ ” Obama said. “This is a process, and it’s sometimes a messy process, just as it was in Iraq.”

Throughout the summit, U.S. officials underscored the challenges ahead, warning that just because there is a calendar for the transition does not mean that a war that has killed almost 2,000 American troops is over.

One area that remains unresolved is the reopening of NATO’s ground supply routes through Pakistan, which the Islamabad government closed in November to protest a U.S. airstrike that killed 24 Pakistani soldiers.

Pakistani President Asif Ali Zardari attended the NATO summit, but Obama did not hold a formal meeting with him. Instead, Obama had what U.S. officials called a “brief pull-aside” with the Pakistani leader and Afghan President Hamid Karzai on the sidelines of the gathering.

In his remarks opening the Monday meeting, Obama pointedly thanked members of the Northern Distribution Network, a collection of Central Asian nations that allow NATO supplies to pass through their territory and into Afghanistan, for their help as Zardari looked on uncomfortably.

The northern route is far longer and more expensive than the Pakistani option, for which Islamabad is discussing a payment rate with U.S. negotiators. Those expenses are expected to rise as NATO begins withdrawing large amounts of equipment from Afghanistan.

“Obviously, we would like to see a reopening of the transit routes as quickly as possible,” said Anders Fogh Rasmussen, NATO’s secretary general. “It goes without saying that it will be quite a logistical challenge to draw down the number of troops in the coming months and years.”

In his news conference, Obama said he did “not want to paper over real challenges” with the Pakistani government, while noting its importance to the war effort, the exit plans and the long-term stability of its fragile neighbor.

“Pakistan has to be part of the solution in Afghanistan,” he said. “We have to work through some of the tensions that have inevitably arisen after 10 years of our military presence in that region.”

The administration is discussing with Karzai’s government the size of a U.S. contingent that will remain beyond 2014 to provide advice and training for the Afghan forces, as well as ongoing counterterrorism operations. Other alliance members are negotiating their own agreements.

Obama said the strategy allows the coalition to “achieve a stable Afghanistan that won’t be perfect.”

“We can pull our troops back in a responsible way,” he said, “and we can start rebuilding America and start making some of the massive investments we have been making in Afghanistan here at home.”

Obama gave an effusive shout-out to Chicago — his “hometown,” as he repeatedly mentioned — and its mayor, former White House chief of staff Rahm Emanuel. “I could not have been prouder,” Obama said. In exchanges with fellow leaders, he said, he “encouraged everybody to shop,” and he presented all of them with a replica of “The Bean,” the landmark sculpture, shaped like a kidney bean but officially known as the Cloud Gate, in Chicago’s Millenium Park.

He apologized to Chicagoans for the traffic jams caused by the presence of the world leaders and said he had slept in a hotel, rather than his own house 15 minutes away, because of the additional traffic his motorcade would cause. Asked about the thousands of demonstrators protesting the war and the economy outside the summit, Obama said, “This is part of what NATO defends.”