WASHINGTON - Top U.S. officials have shown a willingness to adjust President Obama's plan for winding down the war in Afghanistan, allowing military commanders to delay troop departures and expanding combat authorities for forces remaining on the ground. But there's one thing they have made clear is not up for discussion: Obama will end the U.S. military mission entirely by the time he leaves office in January 2017.

Afghan President Ashraf Ghani, who will be in Washington beginning Monday, has asked the president to delay the departure of the approximately 10,000 troops based in Afghanistan, and Obama is expected to announce this week that he will keep as many as 5,000 more U.S. troops in Afghanistan over the next year than originally planned. The overall goal, though, hasn't changed. The president is determined to leave office with fewer than 1,000 U.S. personnel in Afghanistan based at an office of security cooperation in Kabul.

"As a strategic matter, it remains the intent to continue the retrograde," said Jeff Eggers, a senior adviser to the president on Afghanistan and Pakistan. "That's the process that will continue."

The president's desire to end the longest war in American history says more about how he views his legacy than conditions on the ground in Afghanistan, which have continued to deteriorate with the diminished American footprint.

Ghani's request is an acknowledgment of the increase in deaths among Afghan civilians and security forces in the last year.

"The president is pretty clear that he would like to end the war in Afghanistan," said Richard Fontaine, president of the Center for a New American Security, a nonpartisan think tank. "The question is whether the war in Afghanistan is going to let him end it."

For weeks, Obama's top aides have been considering a military request to eliminate a year-end deadline for bringing the number of U.S. troops in Afghanistan to 5,500. The move would give Gen. John F. Campbell, the American commander there, more time to train Afghan forces following last year's disputed Afghan elections, which disrupted the American-led training program. "The political crisis resulted in non-trivial delays to the advisory program," Eggers said.

The delays would allow the United States to keep open two key regional bases in the east and south - the site of some of the heaviest fighting and casualties in recent years - through next year. "Without those bases, you lose your eyes and ears in the most contested areas of the country," said retired Army Lt. Gen David Barno, a former top commander in Afghanistan.

U.S. attack planes and helicopters flying from the two bases in Kandahar and Jalalabad have provided critical firepower to help Afghan army and police forces withstand large-scale Taliban attacks. "That's a big hammer in our toolbox," Barno said.

It would not be the first time the White House has deviated from the plan Obama announced in May 2014 for bringing the war "to a responsible end." In December, facing a shortfall in NATO troop contributions, officials announced they would delay a deadline for reducing the U.S. force to 9,800. Last fall, Obama expanded some authorities for U.S. troops following the end to the NATO combat mission.

Today, the Afghanistan war, despite increasing levels of violence, is largely invisible to the U.S. public. American casualties have plummeted in recent months as U.S. trainers have largely retreated to fortified bases. Only highly trained American counterterrorism forces venture out with any regularity.

The volatile and contentious relationship that Obama had with Hamid Karzai, who frequently blamed the United States for the growing violence, has given way to a quiet partnership with Ghani, his successor. "This is a different relationship," said Eggers. "It is clearly cooperative and better."

Obama probably wouldn't pay a price politically for keeping the current level U.S. troops in the country through the remainder of his presidency. His imperative to withdraw from Afghanistan seems to be a personal one.

The 2017 deadline raises the pressure on Ghanito improve ties with Pakistan, and lay the groundwork for peace talks with the Taliban. Ghani, though, faces massive challenges in holding an unsteady unity government together and in containing the ripple effects of the country's faltering economy, which depends heavily on U.S. financial aid.