Afghanistan’s government officially denied Saturday morning claims that extremists in its territory organized an attack on an air base in Pakistan that killed 29 people. Pakistan previously contended militants in Afghanistan were behind the attack.

Afghan President Ashraf Ghani’s office posted a statement on Twitter denying that the attack was planned in Afghanistan. The attack was the largest made on a military base in Pakistan this year, according to CNN.

“Afghanistan, as a victim of terrorism, feels the agony and pain of terrorism, and commiserates in that spirit with the victims of yesterday’s attacks in Peshawar,” Ghani’s office said in its statement.

Pakistani officials said the attack began early Friday at the Badaber air base, outside the northern city of Peshawar, when gunmen went into a mosque and began shooting. Soon after the assault ended, Maj. Gen. Asim Saleem Bajwa, a Pakistani army representative, said Pakistan believed Afghan militants were behind the attack. Bajwa went on to say the Afghan state was not thought to be directly involved in the attacks.

“The attackers came from Afghanistan,” Bajwa said, according to Deutsche Welle news.

Some of the 29 people slain were praying in the mosque, according to reports. Meanwhile, 14 of the attackers were killed, CNN reported. One expert said that blaming Afghanistan is the easiest way to hide the fact that Pakistan has not been able to control the northwestern area of its territory.

“Bajwa and the army have repeatedly been saying that the ongoing military operation, Zarb-e-Azb, has destroyed the terrorists’ networks and hideouts in the northwestern areas, but the Friday attack at the heart of the army’s own base has proven all these claims wrong,” Abdul Agha, a Pakistan-based journalist, told Deutsche Welle.