In the months leading up to Gen. John W. Nicholson’s departure from Afghanistan in September, his top advisers and staffers set out on an unusual mission, one that took place not in the foothills of the Hindu Kush but inside a compound in Kabul.

Their goal: Find a way to convince President Donald Trump and members of Congress to support troops staying on the ground in the 17-year-long war, according to three individuals involved in the discussions. It was the summer of 2018, public support for U.S. troop presence in Afghanistan had waned, and the president was again threatening to pull the plug on the U.S. mission. Nicholson and his team feared that the American public, too, no longer understood why troops needed to stay.

The goal, one of Nicholson’s top staffers said, was to “get people to care again.” And to do so, they sought to better publicize how the U.S. was increasingly involved in monitoring the growing peace protests across the country and hoped to capitalize off the movement to broker talks between the Taliban and the government.

“There was a massive push to get people to understand that there was still work to do—peace talks to finish,” the source said.

Nearly three months after Nicholson’s departure, however, it seems that his mission has at least partially failed. Gen. Austin S. Miller was installed in place of Nicholson and Zalmay Khalilzad was appointed U.S. special adviser for the country and is currently leading the peace talks.

But President Trump is nevertheless preparing to pull half of U.S. troops (some 7,000 in total) out of Afghanistan. And any hope of Nicholson’s mission succeeding has quickly faded. On the ground, senior advisers and staffers, who have been briefed on the president’s decision, told The Daily Beast morale is at an all-time low.

“We know now that the withdrawal is going to happen,” one senior adviser said. “Now it is just a matter of time until it happens. We had hoped that we could put this off.”

The growing discontent among troops, and what they view as the president’s general lack of regard for their effort, reflects a larger disconnect between the administration’s top military officials and their commander in chief. For more than a year, sources say, U.S. leadership in Kabul and elsewhere in the country have tried to increasingly find ways to garner the attention of, and curry favor with, Trump. But that task has proved difficult as the president’s focus often drifted to internal Washington politics. The president has yet to visit Afghanistan and did not meet with Nicholson before he left his post.

Efforts to put off a hasty withdrawal have been taking place for years. But they culminated during the weeks prior to this summer’s NATO summit when Nicholson’s advisers met in Afghanistan to discuss broad stroke strategy decisions, including publishing more video content about military activities on social media and pushing out information about the growing peace protests. One of the strategy sessions focused on getting the president’s attention by asking Fox News correspondents to embed with troops. The network ultimately did not send a correspondent, two sources familiar with the plan said.

Senior military advisers in Afghanistan told The Daily Beast that former Secretary of Defense Jim Mattis supported the idea of pushing out more content about activities on the ground. And he understood the plan that Khalilzad had set forward to broker negotiations between the Taliban and President Ashraf Ghani—a viewpoint shared by Nicholson.

“It is time for this war in Afghanistan to end,” Nicholson said in his farewell speech in September, later talking directly to the Taliban.

“Whose voices are important?” he asked. “The outsiders who are encouraging you to fight, or the voices of your own people who are encouraging you to peace?”

Mattis resigned from his post Dec. 20 in part over his opposition to Trump’s policy of drawing down troops in Syria and Afghanistan. His departure has senior advisers on the ground in Afghanistan worried there is essentially no top official in the administration who understands their mission and the importance of staying put. Patrick Shanahan, a former Boeing executive, has assumed the title of acting Secretary of Defense but has little experience in military operations.

“ Maybe this wouldn’t have happened under a different president,” one source said. “But we get what we get.”

In a cabinet meeting this Wednesday, Trump was adamant about his decision to withdraw troops from the country.

"I gave our generals all the money they wanted. They didn't do such a great job in Afghanistan," Trump said, later adding that he “essentially fired” Mattis for his lack of progress on the ground.

It’s unclear when or how troops will begin to withdraw from the country. The president has yet to formally announce the official drawback and the Pentagon said it is not ready to announce changes in troop deployments.

"Peace talks with the Taliban continue, we are considering all options of force numbers and disposition," said Lieutenant Colonel Koné Faulkner, a spokesperson for the Pentagon.