A three-day ceasefire in Afghanistan marked by violent attacks has ended amid calls for renewed peace talks between the government and Taliban.

Taliban political spokesman Suhail Shaheen said the negotiating teams of the government and the Islamic Emirate, as the Taliban refers to its ousted regime, met briefly on Saturday in Qatar and renewed their commitment to finding a peaceful end to the war and called for an early start to talks that have been stalled.

The US has been pressing for accelerated talks as it withdraws the last of its 2,500-3,500 soldiers and Nato its remaining 7,000 allied forces.

Even as the Taliban and government signed on to the ceasefire, which was declared to mark the Islamic holiday of Eid-al-Fitr, violence continued unabated in Afghanistan.

A bombing on Friday in a mosque north of the capital killed 12 worshippers, including the prayer leader. Another 15 people were injured. The Taliban denied involvement and blamed the government intelligence agency.

In a statement on Sunday, the Islamic State affiliate took responsibility for the mosque attack, saying its fighters planted an explosive device in "a worship place for disbelievers Sufis", killing the "apostate Imam", or prayer leader. The statement claimed 40 worshipers were injured.

The IS also claimed it blew up several electrical grid stations over the weekend. That left the capital Kabul in the dark for much of the three-day holiday that followed the Muslim fasting month of Ramadan.

In posts on its affiliated websites, IS claimed additional attacks over the last two weeks that destroyed 13 electrical grid stations in several provinces. The stations bring imported power from the Central Asian countries of Uzbekistan and Tajikistan.

The attacks have left nine provinces including Kabul with disrupted power supplies, said government spokesman Sanger Niazai.

There was also concern that local warlords, demanding protection money from the government to safeguard stations in areas they control, may have been behind some of the destruction.

At least one local warlord was arrested last year after demanding protection money.

The seemingly unstoppable violence in Afghanistan has residents and regional countries fearful the final withdrawal of US and Nato soldiers could lead to further chaos.

Washington said it wants its last soldier out of Afghanistan by September 11 at the latest, but the withdrawal is progressing quickly and an official has said it is likely to be completed by early July.

On Saturday, China's foreign minister Wang Yi expressed concern about the rapid withdrawal of US and Nato forces in a phone call with Pakistan counterpart Shah Mehmood Qureshi.

Mr Wang called the withdrawal hasty and warned it would "severely" impact the Afghan peace process and regional stability. He called on the United Nations to play a greater role.