KABUL, Afghanistan — Unnerved by fears of a rushed American deal with Taliban insurgents, President Ashraf Ghani of Afghanistan sent a letter on Tuesday to President Trump offering him reduced costs for keeping United States troops in the country.
The letter, confirmed by three officials and described by one who had seen its contents, is among the strongest signs yet that Mr. Ghani is worried about the consequences of an abrupt American withdrawal from an intractable war that has lasted nearly two decades.
Mr. Ghani has made no secret of his concern about a hasty American exit by an increasingly impatient Mr. Trump, fearing it could unravel the fragile Afghan state and lead to a renaissance in power by the Taliban, which have been steadily gaining territory.
The Afghan leader’s anxiety has punctuated the contrast between the political backdrop in Afghanistan and the circumstances of the American pullout from the other conflict that arose after the Sept. 11, 2001, attacks — the American-led war in Iraq.
Iraqi leaders were by and large happy to see American forces leave. Mr. Ghani, on the other hand, frets about it, partially because the United States is the strongest ally sustaining him in power.
The Afghan leader wrote the letter to Mr. Trump just a few days afterthe most serious negotiationsbetween American diplomats and Taliban representatives ended on what both sides considered an upbeat note in Qatar, 1,200 miles away.
The chief American diplomat, Zalmay Khalilzad, told The New York Times there had beenan agreement on a “framework”for two key issues — that the Taliban would prevent the use of Afghan territory by terror groups like Al Qaeda against the United States, and that the Americans would agree to withdrawing their forces.
Frustrated Afghan officials, who played no role in the negotiations, said they nonetheless saw a confirmation of what many have feared over the past year or so — that the Trump administration, despite having signaled a long-term commitment, cares little for what an American withdrawal could mean for Afghanistan’s 35 million people.
The senior Afghan official who had seen Mr. Ghani’s letter, who spoke on condition of anonymity because the contents were private, said Mr. Ghani and his aides had long discussed how to deal with any possible change of plans by the Trump administration. Those discussions included cost savings and troop reductions and were held with the previous American commander, Gen. John W. Nicholson.
The official said the language of Mr. Ghani’s letter was broad — asking for teams from both sides to discuss details of where costs could be reduced, and how the troop levels could be brought down from the current 14,000 to a “more efficient level.”
The official said the possibilities they had envisioned could save as much as $2 billion a year for the United States, drawing from areas such as maintenance contracts, and reduce the level of American troops to as low a 3,000.
Mr. Ghani alluded to such savingsduring an appearance last weekat the World Economic Forum in Davos, Switzerland, in which he argued for caution in any American withdrawal.
“The United States as a sovereign power, as a global power, is entitled to leave,” he said. “But we need to get the departure right. Are the fundamental reasons that brought the United States to Afghanistan — are those objectives accomplished? The first issue is cost. We completely agree that the cost must come down, must become more efficient.”
The United States Embassy in Kabul declined through a spokesperson to comment on Mr. Ghani’s letter to Mr. Trump, saying “we are not going to get into the specifics of diplomatic conversations.”
It was not immediately clear on Tuesday whether Mr. Trump had received the letter yet. It was sent to him via Alice Wells, the principal deputy assistant secretary for South and Central Asia, who had been visiting Kabul. A spokesman for Mr. Ghani also declined to discuss the letter.
Mr. Ghani has found himself increasingly at odds with other members of the Afghan political elite, who are now rallying around the American effort to negotiate with the Taliban. They are painting Mr. Ghani as an obstacle to peace.
Even as the United States seems close to an agreement with the Taliban on core American interests, the next steps — negotiations over what Afghanistan’s political future could look like — seem daunting.
American officials say the Taliban must engage in direct talks with Afghan leaders about the country’s political future before a withdrawal deal with the United States can be concluded. But the officials acknowledge Mr. Trump’s impatience might not give them much time.
The Taliban have yet to signal a willingness to talk to the Afghan government. And even if the Taliban show that willingness, the Afghan side is divided in ways that seem difficult to reconcile.
Mr. Ghani insists on a strong government role in any future negotiations with the Taliban, and has appointed a negotiating team led by his chief of staff, with several government ministers as members. Other political parties, including many with Taliban contacts, have denounced that negotiating team as unrepresentative.
A meeting between Mr. Khalilzad and Mr. Ghani on Sunday that followed the American talks with the Taliban was described as cold by officials, with no progress made on how to move forward to negotiations between the Afghans and the Taliban.
Mr. Khalilzad’s answers did not satisfy Afghan concerns that the United States was ceding too much to the Taliban too quickly, the officials said.
Mr. Ghani did not share his views in detail at the meeting, which lasted nearly three hours. Instead he opted for a televised address on Monday in which he highlighted previous rushed deals that ended in bloodshed.
“We should not forget that the victims of war are Afghans, so the initiative of peace should be in the hand of Afghans,” Mr. Ghani said in his address.
In another sign of tension with the Americans, Mr. Ghani noted how Afghans are “killed in airstrikes,” a criticism of the United States military he rarely makes publicly. Amrullah Saleh, Mr. Ghani’s interior minister until recently, and who will be running as his vice president in the July elections, was even more emotional.
“Why should Afghans be under this enormous psychological pressure that ‘you are a dependent nation?’” Mr. Saleh said in an interview on the BBC.
“Of course economically we are dependent. But security-wise, also remember the West is dependent on us,” he said. “We are giving the ultimate sacrifice for global security. It’s been our blood and our bones. From the West, recently, it’s only been money and metal — money and weapons. So please, make sure this is not considered a charity case. We are a partner.”
Many of Afghanistan’s opposition leaders see Mr. Ghani as resistant to Americans’ pushing a peace deal because, they said, he worries it could hurt his bid for a second five-year term.
“Instead of creating hope and leading this critical process, the government is trying to damage the process and create fear among the people,” said Hanif Atmar, a former national security adviser challenging Mr. Ghani in the elections.
Mr. Atmar said the government should embrace the prospect of negotiations with the Taliban, and “can only play that role if it comes out of its corner of isolation and narrow-mindness to unite the country and be prepared to sacrifice power for peace.”
In return, Mr. Ghani’s officials say his rivals are blindly embracing the momentum in the American and Taliban talks because they see in it the promise of an interim government that will give them a share of power — even if it means putting the gains of the past 17 years in jeopardy.
Mr. Ghani’s aides warn that a rushed deal, like the one forged in the political vacuum created after the Soviet occupation ended in 1989, can lead to anarchy and bloodshed.
“He has history on his side,” Davood Moradian, the director of the Afghan Institute for Strategic Studies, said of Mr. Ghani’s concerns. “There are many cases that the United States has abandoned its allies, from the shah of Iran to Mubarak of Egypt. He is right to be worried about U.S. abandonment of Afghanistan.”
Worries about a United States withdrawal were reinforced in a report released early Thursday by the Special Inspector General for Afghanistan Reconstruction, an American agency. The Afghan government’s control over the country has declined, the report said, with 63 percent of the population living in areas under the central government’s control as of last fall.
The setback came as the American military ramped up its bombing campaign across Afghanistan fivefold over 2016. Last year alone, American aircraft dropped more than 6,800 munitions, according to the inspector general’s report.
Mr. Moradian said part of Mr. Ghani’s resistance might be an interest in securing another term, but what is at stake for Afghanistan is the future of a system built at enormous cost.
“Knowing Ashraf Ghani,” Mr. Moradian said, “I think he is pursuing self-interest. But in this juncture of history, his interest has been aligned with the interest of state-building and the constitutional order.”