KABUL, Afghanistan — Militants attacked a Shiite shrine in Kabul on Tuesday, killing at least 14 people and deepening fears of a spasm of violence against Afghanistan’s Shiites as they mark one of their most important religious days later this week.

A gunman stormed Sakhi Shrine, the largest Shiite shrine in the capital, killing 13 civilians and one policeman and wounding 26 people, according to Interior Ministry spokesman Sediq Sediqqi. He said the attacker was shot dead by police.

The Shiites were gathering on the eve of Ashoura, when the followers mark the martyrdom of the Prophet Muhammad’s grandson with candlelight vigils and mass public flagellations. Earlier in the week, authorities had warned of the potential for attacks against Shiites, asking them to stay close to home and avoid large gatherings.

The country’s religious authorities have declared Oct. 12 Ashoura Day, the 10th day of the month of Muhharam on the Islamic calendar, to commemorate the death of Imam Hussein in Karbala, Iraq in 680 AD.

The date, a national public holiday, is decided according to the new moon and is the climax of a month of mourning by devout Shiite Muslims.

In Afghanistan, Shiites make up an estimated 15 percent of the population of around 30 million and most of them are ethnic Hazaras. Militant Sunni fundamentalists like the Taliban and the Islamic State group view Shiites as apostates and frequently attack Shiite mosques and public gatherings.

In Kabul, the Afghan capital, Shiite neighborhoods have been decorated with banners and tents. Commemorations will conclude with mourning marches and often-bloody self-flagellations by men using chains and knives to empathize with Hussein’s suffering.

Black tents erected by roadsides dispense free food and tea to pilgrims on foot. Homes and shops are decorated with black and green banners, and many Shiites fix black flags to their cars.

Commemorations were largely banned during the five years when the Taliban controlled the country. But Afghanistan’s Shiites have taken their commemorations more public since the extremists were overthrown in the U.S. invasion of 2001.

In 2011, at least 54 people were killed when a suicide bomber detonated his device at a Kabul shrine where hundreds of people had gathered. A Shiite mosque in the northern city of Mazar-i-Sharif was hit at the same time, leaving four dead.

In July this year, a suicide bomber targeted Hazaras who marched through central Kabul to protest discrimination. At least 80 people were killed and more than 200 wounded in the blast that was claimed by the Islamic State group, which is becoming increasingly active in Afghanistan.

Lt. Gen. Gul Nabi Ahmadzia, the commander of the Kabul garrison, said on Monday he had received credible reports that Ashoura activities will be targeted and called for Shiites to hold the ceremonies “within limits.”

Daiulhaq Abid, the deputy minister for the Hajj and religious affairs, said the Shiite community was issued a directive to keep commemorations low-key, “to ensure better security in Kabul city and the safety of mourners.”

Kabul resident Mohammad Hussain, 20, however, was defiant. “No one can stop them from mourning on Ashoura,” he said. “As much as they (enemies) try to create insecurity, they won’t be able to do it, and it will not demoralize the mourners, because this is the right path and even if we get martyred, it will be on the right path.”

Imam Hussein was killed along with 72 friends and family members at the battle of Karbala. Shiites contend that Hussein’s father Ali was unfairly passed over for leadership of the young Muslim caliphate after the death of the Prophet Muhammad. His death at Karbala was a crucial blow to their rebellion and one of the turning points that spawned Islam’s Sunni-Shiite divide.