President Trump considered firing the top U.S. commander in Afghanistan because he was frustrated by the lack of progress in America's longest-running war, according to a report Wednesday.

During a July 19 meeting, Trump repeatedly suggested that Defense Secretary Jim Mattis and Chairman of the Joint Chiefs of Staff Gen. Joseph Dunford replace Gen. John Nicholson, the top U.S. general in Afghanistan.

Trump expressed frustrations with his advisers tasked with crafting a new strategy for Afghanistan because the U.S. is not winning the war there, sources told NBC News. "We aren't winning," he reportedly said. "We are losing."

Trump's advisers have presented him with a proposal to increase American troop levels to bolster an existing U.S. force of 8,400 troops in Afghanistan to contest the Taliban. Trump has resisted committing to that proposal as some advisers are advocating for a more limited role in Afghanistan.

At more than 15 years, it is America's longest-running war. In recent months the Taliban is gaining territory. It controls about 40 percent of the country, and casualties for government forces reached record levels last year.

In addition, the terrorist group al Qaeda has established new footholds in Afghanistan, the country it used to plan the Sept. 11 attacks. The Islamic State also has established a small presence in Afghanistan.