Open this photo in gallery:

Iranians attend the funerals of security forces personnel killed in recent protests in Tehran on Wednesday.ATTA KENARE/AFP/Getty Images

The head of Iran’s judiciary signalled Wednesday there would be fast trials and executions ahead for those detained in nationwide protests despite a warning from U.S. President Donald Trump.

The comments from Iran’s judiciary chief Gholamhossein Mohseni-Ejei come as activists had warned hangings of those detained could come soon. Already, a bloody security force crackdown on the demonstrations has killed at least 2,571, the U.S.-based Human Rights Activists News Agency reported. That figure dwarfs the death toll from any other round of protest or unrest in Iran in decades and recalls the chaos surrounding the country’s 1979 Islamic Revolution.

Trump repeatedly has warned that the United States may take military action over the killing of peaceful protesters, just months after it bombed Iranian nuclear sites during a 12-day war launched by Israel against the Islamic Republic in June.

Iran defies pressure to withdraw from BRICS military exercise

Tehran has warned neighbours hosting U.S. troops that it would hit American bases if Washington strikes, a senior Iranian official told Reuters on Wednesday.

Three diplomats said some personnel had been advised to leave the main U.S. air base in the region, although there were no immediate signs of a large-scale evacuation of troops as ‍took place in the ​hours before an Iranian missile attack last year.

The diplomats told Reuters that some personnel had been advised to leave the U.S. military’s Al Udeid Air Base in Qatar by Wednesday evening. One of the diplomats described the move as a “posture change” rather than an “ordered evacuation”.

Iran’s clerical rulers face their toughest challenge in decades, but despite nationwide protests and mounting foreign pressure, analysts say the Islamic Republic’s security elite shows no sign of cracking.

Reuters

Meanwhile Wednesday, Iran held a mass funeral of some 100 security force members killed in the demonstrations after authorities earlier said it would be 300. Tens of thousands of mourners attended, holding Iranian flags and photos of Ayatollah Ali Khamenei. The caskets, covered in Iranian flags, stood stacked at least three high. Red and white roses and framed photographs of people who were killed covered them.

People elsewhere remained fearful in the streets. Plain clothes security forces still milled around some neighbourhoods, though anti-riot police and members of the paramilitary Revolutionary Guard’s all-volunteer Basij force appeared to have been sent back to their barracks.

The day my country disappeared from my phone

“We are very frightened because of these sounds [of gunfire] and protests,” said one mother of two children shopping for fruits and vegetables Wednesday, who spoke on condition of anonymity for fear of reprisals. “We have heard many are killed and many are injured. Now peace has been restored but schools are closed and I’m scared to send my children to school again.”

Ahmadreza Tavakoli, 36, told The Associated Press he witnessed one demonstration in Tehran and was shocked by the use of firearms by authorities.

“People were out to express themselves and protest, but quickly it turned into a war zone,” Tavakoli said. “The people do not have guns. Only the security forces have guns.”

Open this photo in gallery:

People light up their phones outside the U.S. consulate during a rally in support of nationwide protests in Iran, in Milan, Italy on Tuesday.Claudia Greco/Reuters

‘We have to do it quickly’

Mohseni-Ejei made the comment in a video shared by Iranian state television online.

“If we want to do a job, we should do it now. If we want to do something, we have to do it quickly,” he said. “If it becomes late, two months, three months later, it doesn’t have the same effect. If we want to do something, we have to do that fast.”

His comments stand as a direct challenge to Trump, who warned Iran about executions an interview with CBS aired Tuesday.

Opinion: Donald Trump could create his own nightmare − soaring oil prices − by attacking Iran

“We will take very strong action,” Trump said. “If they do such a thing, we will take very strong action.”

“We don’t want to see what’s happening in Iran happen. And you know, if they want to have protests, that’s one thing, when they start killing thousands of people, and now you’re telling me about hanging – we’ll see how that works out for them. It’s not going to work out good.”

One Arab Gulf diplomat told the AP that major Mideast governments had been discouraging the Trump administration from launching a war now with Iran, fearing “unprecedented consequences” for the region that could explode into a “full-blown war.” The diplomat spoke on condition of anonymity because he wasn’t authorized to speak to journalists.

Meanwhile, activists said Wednesday that Starlink was offering free service in Iran. The satellite internet service has been key in getting around an internet shutdown launched by the theocracy on Jan. 8. Iran began allowing people to call out internationally on Tuesday via their mobile phones, but calls from people outside the country into Iran remain blocked.

“We can confirm that the free subscription for Starlink terminals is fully functional,” said Mehdi Yahyanejad, a Los Angeles-based activist who has helped get the units into Iran. “We tested it using a newly activated Starlink terminal inside Iran.”

Opinion: As Iran cracks down on protesters again, the world cannot be silent

Starlink itself did not immediately acknowledge the decision.

Security service personnel also apparently were searching for Starlink dishes, as people in northern Tehran reported authorities raiding apartment buildings with satellite dishes. While satellite television dishes are illegal, many in the capital have them in homes, and officials broadly had given up on enforcing the law in recent years.

Death toll continues to rise

The Human Rights Activists News Agency said 2,403 of the dead were protesters and 147 were government-affiliated. Twelve children were killed, along with nine civilians it said were not taking part in protests. More than 18,100 people have been detained, the group said.

Gauging the demonstrations from abroad has grown more difficult, and the AP has been unable to independently assess the toll given the communications being disrupted in the country.

With a report from Reuters

Open this photo in gallery:

People walk past a large patriotic banner depicting the Iranian flag on Enghelab Square in Tehran.ATTA KENARE/AFP/Getty Images