The body of a militant fighter, wearing a U.S. military uniform, lies inside the Interior Ministry building after a deadly attack, in Kabul, Afghanistan, Wednesday, May 30, 2018.

KABUL, Afghanistan — Gunmen dressed as U.S. soldiers and traveling in a captured Humvee set off a suicide bomb and then tried to shoot their way into the Afghan Interior Ministry before being killed by government forces Wednesday, security officials said.

It’s not clear who carried out the attack — one of at least three that occurred in Afghanistan on Wednesday — that targeted the Interior Ministry’s compound a few hundred yards from Kabul’s airport and a coalition air base where Americans and their allies train Afghan forces.

Just after midday, a car bomb exploded at the entrance to the ministry compound, said Hashmat Stanekzai, spokesman for Kabul police.

“After that, several gunmen tried to get into the ministry, but they faced resistance by our security forces,” he said. “The attackers were not able to enter the ministry.”

The firefight ended a little more than two hour later, he said, and all the gunmen had been killed. He could not say how many other casualties there were besides the assailants.

At least one of the attackers was captured, Gen. John Nicholson, the top U.S. commander in the country, told reporters at the Pentagon via video conference later in the day.

But Nicholson disputed claims by the Islamic State group’s Afghanistan affiliate that it was responsible for the attack. Both the Taliban and ISIS have carried out attacks that have left hundreds dead in recent months. The Taliban, however, had not claimed responsibility for the attack.

The tactics smacked more of the Taliban’s Haqqani network, Nicholson said, referring to a brutal branch of the insurgent group considered its most capable. For example, their use of American uniforms and their targeting of a government facility.

“We have seen [American] uniforms used in the past,” the American general said. “It’s been well over a year since we’ve seen that.”

ISIS attacks tend to be person-borne, involving suicide vests, and indiscriminate, often targeting Shiite minorities in the country.

The use of military uniforms and a vehicle was a concern, Nicholson said, as it might cause a hesitation or delay in responding to the attack. However, he said the Afghans responded as they should have.

“They did exactly what they were supposed to do,” he said.

The guards at the gate recognized that the uniforms were dated versions of those worn by U.S. soldiers and demanded the attackers exit the vehicle. That’s when the fighting started, Nicholson said, and one of the attackers detonated a suicide vest, killing himself and some of his fellow gunmen.

The Crisis Response Unit 222, a special police unit, responded to the attack and quickly killed the remaining assailants, Nicholson said.

Seven gunmen had attempted to enter the compound, said Interior Ministry spokesman Najib Danish. One police officer was killed and five were wounded, he said.

Washington Post reporter Dan Lamothe said on Twitter that the nearby coalition base was locked down for about an hour after the attack. In a later tweet, he said there were concerns that an attacker in a U.S. military uniform was on the base and that head counts were underway.

There was no breach of the NATO compound, said Lt. Col. Martin O’Donnell, a spokesman for the coalition in Kabul. He said all coalition troops had been accounted for after the attack.

Two other attacks occurred elsewhere in Afghanistan on Wednesday.

In eastern Logar province, suicide bombers attacked a police station in the morning, killing at least three police officers, including the station’s commander and the deputy director of traffic police for the provincial capital, Pul-e Alam, local media reported. A suicide car bomb was set off at the gates before three gunmen in suicide vests stormed the compound.

Four more police officers and eight civilians were wounded in the attack. Among the wounded were two children, the media reported. The Taliban claimed responsibility for the attack.

Another early morning attack struck the capital of Kandahar province, when a suicide car bomb blast killed three civilians and wounded 13 others, a provincial official told reporters. It is unclear who carried out the attack, though the southern province is the Taliban’s historic heartland.

Afghan officials have said recently that their forces were battling militants in at least half of the country’s 34 provinces and that at least seven provincial capitals were under threat.

On Tuesday, Taliban fighters overran the center of Chora district in the southern province of Uruzgan. A provincial official who spoke to Stars and Stripes on condition of anonymity confirmed that Afghan security forces had withdrawn from the governor’s compound and police headquarters.

The militants were also threatening to overrun parts of Takhar province in the country’s north this week, claiming to have seized arms and equipment after seizing police checkpoints in the besieged Kwajah Ghar and Dasht-e Qalah districts along the Tajikistan border.

The Kabul attack comes nearly one year after a massive car bombing near the diplomatic zone of the city, which killed several hundred people on May 31, 2017.

Nicholson credited the response to the latest attack, and the fact that there has been no “mega” vehicle-borne attack in the past 12 months as a sign of improving Afghan security forces capabilities.

“We’ve had a slight reduction in the number of vehicle-borne (improvised explosive devices),” Nicholson said. “We’ve also seen … a reduction in Taliban and Haqqani activity … because of the very focused counter-terrorism effort on the networks that attack Kabul.”

However, he said a purported drop in Taliban and Haqqani attacks has been offset by increasing ISIS attacks.

Stars and Stripes reporter Corey Dickstein contributed to this report.

garland.chad@stripes.com

Twitter: @chadgarland

dickstein.corey@stripes.com

Twitter: @CDicksteinDC