KABUL - An explosion hit a mosque in Afghanistan's capital near the heavily fortified interior ministry compound on Wednesday, killing four people and wounding 25, a ministry spokesman said.

The government did not immediately say what caused the blast in Kabul, where Islamist militants have carried out a number of attacks in recent months.

"The mosque was used by visitors and sometimes by interior ministry employees," said interior ministry spokesman Abdul Nafi Takor, who confirmed the casualty toll.

Italian NGO aid group Emergency, which runs a hospital in Kabul, said on Twitter that it had received 20 patients from the blast, two of whom were dead on arrival.

The interior ministry compound is in a secure area next to Kabul international airport.

The ruling Taliban have said they have secured the country since taking over in 2021 after a two-decade insurgency. But although widespread fighting has ended, a series of blasts have hit urban centres in recent months.

An explosion at an education centre in West Kabul on Friday killed 53 people, most of them young women, according to the United Nations Mission to Afghanistan.

(Reporting by Mohammad Yunus Yawar; Writing by Gibran Peshimam; Editing by Andrew Heavens)