Washington (CNN)America's longest war just got a little longer for thousands of U.S. troops.
President Barack Obama's decision to keep 9,800 soldiers in Afghanistan through this year -- double what was previously planned -- represents an American bet that a new president, Ashraf Ghani, might finally be the reliable partner in Kabul who can solidify gains, such as they are, of the 14-year U.S. mission.
But though Obama has long pined for a dependable counterpart in Afghanistan and hoped for greater stability there, Ghani's arrival comes with a significant political price.
In order to bolster Ghani, who emerged as the winner after a U.S.-brokered settlement to a disputed Afghan election last year, Obama has had little choice but to accept his appeals for more U.S. troops to stay longer in Afghanistan.
And Tuesday's concession on slowing troop withdrawals sets up an even greater dilemma for Obama, who sees his historic role as concluding the expansive land wars he inherited in Afghanistan and Iraq. It also carries the risk of another misplaced gamble on another leader in the Middle East or South Asia who doesn't, or can't, deliver the friendly, solid leadership the U.S. desires.
So far, Obama and Ghani have been making a show of camaraderie.
Ghani is basking in an effusive reception during a visit to Washington this week, a sharp contrast to the antagonism and treading on eggshells that characterized Obama's poisoned dealings with ex-president Hamid Karzai.
And over and over, he is expressing deep gratitude for the sacrifices made by the United States to keep the Taliban at bay in Afghanistan,
It is clear from the lavish welcome offered to Ghani -- a trip to Camp David, five hours in the White House and an address to Congress -- that the administration sees him as everything Karzai was not.
Where Karzai was erratic, Ghani seems calm. Ghani favors a sharp Western business suit rather than the exotic flowing green robe that Karzai made famous. Where Karzai raged at civilian casualties in U.S. operations, Ghani is expressing deep and repeated gratitude for the price paid by the United States to keep the Taliban at bay in Afghanistan.
"The people of Afghanistan recognize the bravery of your soldiers and the tremendous sacrifices that Americans have made to keep Afghanistan free," Ghani told a joint session of Congress on Wednesday to applause from the chamber.
"We owe a profound debt to the 2,350 servicemen and women killed and the more than 20,000 who have been wounded in (the) service of your country and ours," he said. "Thank you for staying."
Ghani's comments are part of a clear strategy to secure long-term U.S. support for Afghanistan's armed forces -- which now have primary responsibility for combat. He not only personally offered Obama praise but painstakingly singled out the long list of generals who have run the Afghan war, ambassadors appointed by Republican and Democratic administrations, and politically powerful lawmakers in both parties.
In the short term, Ghani's visit does represent a tangible success for an administration that has struggled to rack up foreign policy wins, and a desire to cement Ghani in power will be one of Obama's goals.
But later this year, or early next, Obama must decide whether to honor his vow to get every American -- save for a small detachment at the U.S. embassy -- home from Afghanistan or to pass on an enduring war to a third U.S. president when he leaves office in January 2017.
"I think right now his intention is to stick to it. That's what he would like to do, and we know that is the legacy he would like to leave -- as the president who ended two wars," said Scott Smith, a former senior United Nations official in Afghanistan now with the US Institute of Peace.
"But I think there is a very strong bipartisan consensus in Washington and on the Hill that it may be worth reconsidering this decision."
Obama insisted at Tuesday's press conference with Ghani that the 2016 date for a full withdrawal was not negotiable.
"This flexibility reflects our reinvigorated partnership with Afghanistan, which is aimed at making Afghanistan secure and preventing it from being used to launch terrorist attacks," Obama said.
But the president added: "This specific trajectory of the 2016 drawdown will be established later this year to enable our final consolidation to a Kabul-based embassy presence by the end of 2016."
Holding off on that decision makes sense for Obama, simply because of the elevated political stakes.
But he will soon face familiar charges from Republican opponents that he is once again making strategic military decisions for political reasons, not based on battlefield conditions.
And he will have to weigh whether a full departure of U.S. troops would weaken the fledgling Afghan forces, diminish American leverage with the Ghani government and offer an opening to the Taliban and other extremist groups.
A key driver of his decision could be whether Ghani turns out to justify the hopes that are being placed in him and whether his current truce with his election foe, former foreign minister Abdullah Abdullah, holds.
Ghani inspires confidence abroad, partly because he speaks the twin languages of the Western elite — English and Commerce. An ethnic Pashtun, he's an academic, who was educated at Columbia University, worked for the World Bank and is a former finance minister won approval among outsiders for his economic reforms. He also lacks the past links to warlordism and violence of many others who came to prominence during Afghanistan's war torn modern history.
"Every indication so far is that President Ghani wants to work closely with the U.S. and shares a lot of U.S. concerns on issues like corruption and so on," said Nora Bensahel, a defense specialist at American University.
Importantly, Ghani is also sending a message to his own domestic constituency that he wants American troops to stay -- a step that was not taken by former Iraqi prime minister Nuri al-Maliki, another post-war leader in whom the U.S. placed disproportionate hopes, ultimately souring the relationship and solidifying Obama's intent to fully withdraw from that country.
And there are no guarantees that Ghani, over the long-term will continue to enjoy the honeymoon that he experienced in the White House on Tuesday -- especially as political conditions in Afghanistan remain dangerous.
"There's not going to be a meltdown in Ghani-Obama relations, but there could be a meltdown in Ghani-Abdullah relations or some other catastrophic event in Afghanistan that could change the whole picture," said Michael O'Hanlon of the Brookings Institution.
"Ghani is not going to be able to be a miracle worker and fix all of Afghanistan's problems."
The U.S. has been stymied by the depths of the rugged country's problems and complicated politics before. And there is a cautionary tale of a White House wagering too much on a promising Afghan leader.
More than a decade ago, another urbane, bearded and smiling Afghan leader came to Washington, stood in the White House and Congress, and told Americans, still traumatized by the September 11 attacks in 2001, what they wanted to hear.
That man's name was Hamid Karzai.
"Ten years ago, a Karzai visit to Washington would have been greeted with the same kind of welcome and excitement and positivity that this first visit from President Ghani has," said Smith.
But as the war dragged on, Karzai became embittered that the United States went to war in Iraq and seemed to turn away from Afghanistan.
When Obama came to power, the White House adopted a hands-off approach with Karzai despite sending a surge of U.S. troops to try and finish off the Afghan war. Soon allegations of corruption around Karzai found their way into the U.S. press and the Afghan leader's relations with Washington went badly astray.
Still, for now the untested Ghani may represent Obama's best hope of getting out of Afghanistan without another blemish on a legacy aimed at ending wars -- one that has already been tarnished by his decision to send troops back to Iraq to fight ISIS.
"I do think the president has a very real choice to make. I don't think he is being forced into this by any pressure Ghani has put on him," Bensahel said.
"He has a lot politically at stake."