Protests have continued through the night in Iran after thousands of mourners marked 40 days since the death of Mahsa Amini which sparked a wave of unrest across the Islamic republic.

The attack on the Shiraz shrine in Saqez left at least 15 people dead came as thousands of people paid tribute to Ms Amini, a 22-year-old Iranian of Kurdish origin who died on 16 September, three days after her arrest in Tehran by the morality police for allegedly breaching the Islamic dress code for women.

More than five weeks after Amini's death, the demonstrations show no signs of ending, fuelled by public outrage over a crackdown that has claimed the lives of other young women and girls.

Iran's President Ebrahim Raisi said that "riots" pave the way for terror attacks.

"The intention of the enemy is to disrupt the country's progress, and then these riots pave the ground for terrorist acts," he said in televised remarks.

State television said the attack on the shrine was carried out by an armed "terrorist" during evening prayers at the Shah Cheragh mausoleum, and left at least 19 people wounded.

The assailant was a man "in his 30s" who had been detained by the security forces, officials said.

Mr Raisi vowed "a severe response", according to a presidency statement and condemned "the enemies of Iran" who attempt to "divide the united ranks of the nation... through violence and terror."

Despite heightened security measures which have seen people arrested for protesting, in a virally-shared picture verified by AFP, a young woman was seen standing on the roof of a car without a hijab head covering, looking into the distance at the highway packed with vehicles and people.

Mourners chanted at the Aichi cemetery outside Saqez, before many were seen heading to the governor's office in the city centre, where Iranian media outlets said some were poised to attack an army base.

"Security forces have shot tear gas and opened fire on people in Zindan square, Saqez city," the Hengaw rights group said, without specifying whether the people were any dead or wounded.

After nightfall, blasts were heard as security forces fired on protesters in Marivan, Kurdistan province, in a video published by Hengaw, a Norway-based organisation.

Iran's judiciary has pressed charges against more than 1,000 people arrested in connection to the protests.

At least four were charged with an offence that can carry the death penalty, while others accused of "acting against the country's security", "propaganda" against the regime and "assaulting security forces".

Officials had said that hundreds of those who were not involved in the "riots" had been released.

Workers clean up the scene following an armed attack at the Shah Cheragh mausoleum in Shiraz

Iran's ISNA news agency said the internet had been cut in Saqez for "security reasons", and that nearly 10,000 people had gathered in the city.

But many thousands more were seen making their way in cars, on motorbikes and on foot along a highway, through fields and even across a river, in videos widely shared online.

It comes as Iran's prime minister has called for Iranians to unite against security threats following the attack on the shrine.

"Death to the dictator," protesters chanted in the nearby city of Bukan, where bonfires burned in the streets.

Protesters also surrounded a base of the Basij militia in Sanandaj, a flashpoint city in Kurdistan province, starting fires and driving security forces back.

There were similar scenes in Ilam city, near Iran's western border with Iraq.

Noisily clapping, shouting and honking car horns, mourners packed the highway linking Saqez to the cemetery 8kms away, in images Hengaw said it had verified.

ISNA said some of the crowd returning from the cemetery had "intended to attack an army base", until they were dispersed by other participants.

A police checkpoint was torched and fires burned beside a bridge in the Qavakh neighbourhood of Saqez, according to a verified video.

"This year is the year of blood, Seyed Ali will be toppled," a group of them chanted in footage verified by AFP, referring to Iran's supreme leader Ayatollah Ali Khamenei.

Hengaw said workers went on strike in Saqez as well as Divandarreh, Marivan, Kamyaran and Sanandaj, and in Javanrud and Ravansar in the western province of Kermanshah.

International response

Kurdistan governor Esmail Zarei-Kousha accused Iran's foes of being behind the unrest.

"The enemy and its media... are trying to use the 40-day anniversary of Mahsa Amini's death as a pretext to cause new tensions but fortunately the situation in the province is completely stable," he was quoted as saying by state news agency IRNA.

Oslo-based group Iran Human Rights says the security forces' crackdown on the protests has claimed the lives of at least 141 demonstrators, including at least 29 children.

Iranian-Americans and their supporters during a vigil in support of protestors in Iran

Amnesty International said the "unrelenting brutal crackdown" has killed at least 23 children.

The US has put sanctions on more than a dozen Iranian officials over the bloody response to the protests.

The White House said it was "concerned that Moscow may be advising Iran on best practices to manage protests, drawing on... extensive experience in suppressing" opponents.

The social media channel 1500tasvir, which chronicles rights violations by Iran's security forces, said fresh protests flared at universities in Tehran, Mashhad in Iran's northeast, and Ahvaz in the southwest, among others.