Suicide bombers struck two mosques in Afghanistan during Friday prayers, a Shia mosque in Kabul and a Sunni mosque in western Ghor province, killing at least 63 people at the end of a particularly deadly week for the troubled nation.

The Afghan president issued a statement condemning both attacks and saying that country's security forces would step up the fight to "eliminate the terrorists who target Afghans of all religions and tribes."

In the attack in Kabul, a suicide bomber walked into the Imam Zaman Mosque, a Shia mosque in the western Dashte-e-Barchi neighbourhood where he detonated his explosives vest, killing 30 and wounding 45, said Maj.-Gen. Alimast Momand at the Interior Ministry.

The suicide bombing in Ghor province struck a Sunni mosque, also during Friday prayers and killed 33 people, including a warlord who was apparently the target of the attack, said Mohammad Iqbal Nizami, the spokesperson for the provincial chief of police.

No group immediately claimed responsibility for either attack, the latest in a devastating week that saw Taliban attacks kill scores across the country.

The U.S. government strongly condemned the attacks in Kabul and Ghor, as well as other attacks carried out across Afghanistan this week.

"In the face of these senseless and cowardly acts, our commitment to Afghanistan is unwavering. The United States stands with the government and people of Afghanistan and will continue to support their efforts to achieve peace and security for their country," said state department spokesperson Heather Nauert in a statement.

Mosque packed before bombing

In the Kabul attack, eyewitness Ali Mohammad said the mosque was packed with worshippers, both men and women praying at the height of the Muslim week. The explosion was so strong that it shattered windows on nearby buildings, he said.

Local residents who rushed to the scene to help the victims were overcome with anger and started chanting, "Death to ISIS"— a reference to the Islamic State group which has staged similar attacks on Shia mosques in recent months.

Abdul Hussain Hussainzada, a Shia community leader, said they are sure that Afghanistan's ISIS affiliate was behind the attack. "Our community is very worried," Hussainzada told The Associated Press.

Dasht-e-Barchi is a sprawling neighbourhood in the west of Kabul where the majority of people are ethnic Hazaras, who are mostly Shia Muslims, a minority in Afghanistan, which is a Sunni majority nation.

Afghan bombings

The bombings on Friday occurred in Kabul and in Ghor province. (CBC)

As attacks targeting Shia have increased in Kabul, residents of this area have grown increasingly afraid. Most schools have additional armed guards from among the local population.

The so-called Islamic State in Afghanistan has taken responsibility for most of the attacks targeting Shia, whom the Sunni extremist group considers to be apostates. Earlier this year, following an attack claimed by ISIS on the Iraqi Embassy in Kabul, the militant group effectively declared war on Afghanistan's Shias, saying they would be the target of future attacks.

Several mosques have been attacked following this warning, killing scores of Shia worshippers in Kabul and in western Herat province. Residents say attendance at local Shia mosques in Kabul on Friday has dropped by at least one-third.

Hussainzada, the spiritual head of Afghanistan's ethnic Hazaras, said the suicide bomber had positioned himself at the front of the prayer hall, standing with other men in the first of dozens of rows of worshippers before exploding his device. He appeared to be Uzbek, added Hussainzada.

Members of the Islamic Movement of Uzbekistan militant group, who are in Afghanistan in the hundreds, have pledged allegiance to the Islamic State affiliate, known as the Islamic State Khorasan Province — an ancient term for what today includes parts of Iran, Afghanistan, Pakistan and Central Asia.

Ex-warlord targeted

The attack on the Sunni mosque in Ghor province took place in the Do Laina district, according to Nizami, the police spokesperson. Nizami says the target apparently was a local commander, Abdul Ahed, a former warlord who has sided with the government. Seven of his bodyguards were also killed in the bombing.

In his statement, President Ghani said the bombings show that "the terrorists have once again staged bloody attacks but they will not achieve their evil purposes and sow discord among the Afghans."

It has been a brutal week in Afghanistan, with more than 70 killed, mostly police officers and Afghan soldiers but also civilians as militant attacks have surged. The Taliban have taken responsibility for the earlier assaults this week that struck on security installations in the east and west of the country.

Overnight on Wednesday and into Thursday, the Taliban killed at least 58 Afghan security forces in attacks that included an assault that nearly wiped out an army camp in southern Kandahar province.

And on Tuesday, the Taliban unleashed a wave of attacks across Afghanistan, targeting police compounds and government facilities with suicide bombers, and killing at least 74 people, officials said.

Afghan forces have struggled to combat a resurgent Taliban since U.S. and NATO forces formally concluded their combat mission at the end of 2014, switching to a counterterrorism and support role.