KABUL, Afghanistan — Afghanistan’s intelligence agency said on Wednesday that the mastermind of a bloody attack on the agency’s base this week had been killed in an airstrike, but residents and local officials in the area said the airstrike had in fact targeted a group of hunters on a hilltop.

In a daring attack on Monday, the Taliban used an armored Humvee it had seized from Afghan forces, packing it with explosives and driving it onto an Afghan intelligence base to detonate. At least 40 intelligence personnel were killed and 60 others were wounded.

The intelligence agency, the National Directorate of Security, said in a statement on Wednesday that its forces had traced the mastermind of that attack, a man they identified as Commander Noman. The agency said it had targeted him and seven others it described as terrorists on Tuesday with an airstrike in Maidan Shahr, in the center of Wardak Province.

“He was targeted in the provincial capital,” the statement added.

The agency did not say who had executed the strike, though Afghan forces often rely on the American military to carry out airstrikes. A spokesman for the American military in Afghanistan said that United States forces had carried out a strike in Wardak, without providing further details.