Suspected militants unsuccessfully tried to target Secretary of Defense James Mattis in a massive rocket attack during his surprise visit to Kabul, Afghanistan, on September 27.

Insurgents fired more than two dozen rocket-propelled grenades toward Kabul’s Hamid Karzai International Airport, where Mattis, along with NATO Secretary General Jens Stoltenberg, had landed for an unannounced visit to meet with Afghan officials.

Fortunately, Mattis and Stoltenberg had already left the airport hours earlier, but Afghan Interior Ministry spokesperson Najib Danish told reporters that at least one woman died and 11 other civilians were injured in the attack.

The Taliban claimed responsibility for the strike, as did ISIS. But two Taliban commanders told NBC News that they had “insiders” in Afghanistan’s security bureaucracy that had informed them of Mattis’s impending arrival.

At a press conference with Afghan President Ashraf Ghani and Stoltenberg, Mattis told reporters he had only heard a few reports of the attack so far, but that “an attack on an airport anywhere in the world is a criminal act by terrorist."

"If, in fact, this is what they have done, they will find the Afghan Security Forces continuing on the offensive against them in every district of the country right now," Mattis said.

After firing their weapons, three assailants entered a house behind the airport. Kabul police launched a six-hour operation to clear the house, ultimately killing the attackers.

Mattis is in the country to discuss the Trump administration’s new Afghanistan strategy, which calls for defeating terrorists in the country. Having the Taliban attempt such a brazen attack on him the very first day he arrives — perhaps based on information that came from inside the Afghan security establishment itself — is not exactly the most auspicious start to his trip.

Trump wants to win in Afghanistan — but that will be hard

On August 21, President Donald Trump outlined his new Afghanistan war plan, declaring that “we will win.” But he refused to disclose when US troops would come home. “Conditions on the ground, not arbitrary timetables, will guide our strategy from now on,” he said.

One day after Trump’s comments, Secretary of State Rex Tillerson offered a different assessment of America’s goals in Afghanistan. “I think the president was clear this entire effort was intended to put pressure on the Taliban, to have the Taliban understand that you will not win a battlefield victory,” Tillerson said during a press conference. “We may not win one, but neither will you.”

And on September 18, Mattis announced that the US would send at least 3,000 more troops to Afghanistan, increasing the total to more than 14,000. But it’s unclear how sending a few thousand more troops will turn around the dire situation in Afghanistan.

In 2011, the US had around 100,000 troops deployed in the country in part to weaken the Taliban enough that it would negotiate an end to the violence. But lately the militant group has made a startling comeback. It currently controls more than 40 percent of the country, and around 8.4 million Afghans, about a third of the country’s population, live under its rule.

Since 2001, the war in Afghanistan has cost the US at least $714 billion and 2,264 American lives. Yet the US has little to show for its efforts. And now the Taliban feels emboldened enough to attack the top US defense official in Kabul — after possibly getting help from Afghan security officials.

Trump says he wants to win this war, but it looks like the fight is only getting tougher.