A suicide bomber attacked a Shi'ite Muslim shrine in central Kabul on Tuesday where a crowd of hundreds had gathered for the festival of Ashura, killing up to 20 people in what appeared to be an unprecedented sectarian attack.

Mohammad Zahir, head of Kabul's Criminal Investigation Department, said he had counted up to 20 bodies at a Kabul hospital, and expected the toll to rise.

Afghanistan has a history of tension and violence between Sunnis and the Shi'ite minority, but since the fall of the Taliban the country had been spared the large scale sectarian attacks that have troubled neighbouring Pakistan.

The noon bomb in a riverside shrine, in the heart of old Kabul, appears to set a grim new precedent.

Shortly after, a bicycle bomb exploded near the main mosque in the northern city of Mazar-i-Sharif, killing four people and injuring 17 others.

The city's streets were filled with people celebrating Ashura, but it was not immediately clear if that attack was also targeting Shi'ite worshippers.

Taliban spokesmen could not immediately be reached for comment on either attack.

The Shi'ite Muslim festival of Ashura marks the martyrdom of the Prophet Mohammad's grandson Hussein in the battle of Karbala in Iraq in the year 680.

Ashura is the biggest event in the Shi'ite Muslim calendar, when large processions are vulnerable to militant attacks, including suicide bombings. Pakistan has deployed tens of thousands of paramilitary soldiers and police during Ashura.

Blood has spilled between Pakistan's majority Sunni and minority Shi'ite militants for decades.

Sectarian strife has intensified since Sunni militants deepened ties with al Qaeda and Pakistani Taliban insurgents after Pakistan joined the U.S.-led campaign against militancy after the September 11 attacks.

(Reporting by Mirwais Harooni, writing by Emma Graham-Harrison, editing by Daniel Magnowski and Jonathan Thatcher)