At least 40 people were killed and 40 others injured Friday as a suicide bomber blew himself up outside a mosque in northern Afghanistan, where worshippers gathered to offer prayers on the occasion of the Muslim festival of Eid al-Adha, Reuters reported.

The blast took place at Maimana, capital of Faryab province, at 9 am local time.

No one has claimed responsibility for the blast, but the authorities have termed it as a handiwork of the Taliban. However, the Taliban said they were investigating the incident. "This issue is under investigation, and I am in touch with the local Taliban," said a spokesman, Qari Yousef Ahmadi.

"The suicide bomber detonated explosives when our countrymen were congratulating each other on the Eid holiday," said police spokesman Lal Mohammad Ahmadzai, according to Reuters.

The spokesman said that the attack appeared to target regional police chief General Abdul Khaliq Aqsai.  “As soon as the police chief got in his vehicle, the bomber detonated his explosives," he said. Aqsai escaped the blast.

Half of the people dead in the blast were policemen and the victims included five children.

"It was a massacre," said Khaled, a doctor who was at the mosque and narrowly escaped the blast. "There was blood and dead bodies everywhere," he told the Associated Press.

In a statement, President Hamid Karzai condemned the attack.

The violence in Afghanistan has escalated as the NATO troops are preparing to withdraw from the country by 2014.