President Donald Trump at the White House. AP Photo/Evan Vucci

During a tense mid-July meeting with his national-security team, President Donald Trump dismissed the counsel of high-ranking military commanders, saying he leaned toward the advice of rank-and-file soldiers over that of his generals.

According to an NBC News report, Trump singled out Defense Secretary James Mattis, a retired Marine general, saying he had given Mattis authority to make decisions about the war months prior but had seen little progress.

Trump delegated authority to Mattis to set troop levels in Afghanistan in June, though the secretary would need White House permission to send more than 3,900 troops to the war-torn country.

"We aren't winning," Trump said at the July 19 meeting, senior administration officials told NBC. "We are losing." (Mattis himself told the Senate Armed Services Committee the same in July.)

One official told NBC that Trump's military advisers entered the meeting hoping he would agree to a strategy for the US's nearly 16-year-old war. But Trump's thinking appeared to have been influenced by another meeting he had with veterans from the war.

"We've been there for now close to 17 years, and I want to find out why we’ve been there for 17 years, how it’s going, and what we should do in terms of additional ideas,” Trump said prior to the meeting with veterans. "I've heard plenty of ideas from a lot of people, but I want to hear it from the people on the ground."

President Donald Trump and Defense Secretary James Mattis at a cabinet meeting at the White House, March 13, 2017. REUTERS/Jonathan Ernst

Trump told his national-security advisers that the veterans he met with told him NATO forces deployed to Afghanistan to assist the US had been of little help and complained about China profiting off Afghanistan's estimated $1 trillion in rare minerals — mineral rights China bought years ago with US support.

Trump relayed an anecdote about a troubled restaurant renovation in New York City in the 1980s to highlight how he thought his high-ranking advisers were failing him.

"Officials said Trump kept stressing the idea that lousy advice cost the owner a year of lost business and that talking to the restaurant's waiters instead might have yielded a better result," NBC reported. "He also said the tendency is to assume if someone isn't a three-star general he doesn't know what he's talking about, and that in his own experience in business talking to low-ranking workers has gotten him better outcomes."

According to NBC, the restaurant closed for two months in 1987 for a full renovation before reopening to acclaim.

US soldiers stand guard near the site of a US bombing in the Achin district of Nangarhar province in eastern Afghanistan, April 15, 2017. Thomson Reuters

Other Trump advisers have reportedly solicited advice on the war in Afghanistan from Erik Prince, founder of the Blackwater private-security firm. Steve Bannon, Trump's chief strategist, and Jared Kushner, the president's senior adviser and son-in-law, were able to get Prince into a meeting with Mattis in July, but the defense secretary declined to include Prince's ideas in his review of the war.

The meeting left Trump's advisers frustrated and, according to NBC, ended without a firm decision about the future of Army Gen. John Nicholson, the US commander in Afghanistan.

Nicholson is the 12th person to hold the top job in Afghanistan. He has called the situation there a stalemate and cautioned Congress that more US troops may needed to counter outside influence there — from Russia in particular.

An Afghan policeman stands guard near the site where a suicide bomber struck a NATO convoy on Aug. 2, 2017. Associated Press

Nicholson also decided to drop the US's "mother of all bombs" — the 21,000-pound GBU-43/B Massive Ordnance Air Blast bomb — on an ISIS compound in Nangarhar province in eastern Afghanistan in April.

According to military experts who spoke with NBC, it would be unwise to rely on input from ground troops to formulate an overarching strategy, particularly in a war like that in Afghanistan.

"They're qualified totally to talk about tactics and things like that and what they're seeing," retired four-star Army Gen. Barry McCaffrey told NBC, "but the president's job is to formulate strategy and policy not to do tactical decisions."

Since the war began in 2001, at least 2,400 US service members have been killed in or around Afghanistan. Two US service members were killed on Wednesday in a suicide-car-bomb attack on a NATO convoy in southwestern Afghanistan, bringing the total killed this year to 11.