Iran signalled Sunday it favours a de-escalation after 10 days of heightened tensions with the United States during which both sides fired missiles and Tehran accidentally shot down a passenger aircraft.
Security was stepped up in Iran's capital after a vigil the previous night for those killed in the air disaster turned into an angry protest and police temporarily arrested the British ambassador for being there.
US President Donald Trump warned Iran against harming demonstrators and against a repeat of a deadly crackdown against rallies in November sparked by a fuel price hike.
"To the leaders of Iran - DO NOT KILL YOUR PROTESTERS," Trump tweeted in his occasional all-capitals style.
US Defence Secretary Mark Esper, however, said Trump was still willing to "sit down and discuss without precondition a new way forward" with Iran, although Tehran has steadfastly refused to hold talks with Washington unless it lifts sanctions first.
Tehran said it favoured an easing of tensions after its arch-enemy Washington on January 3 killed a revered Iranian general, Quds Force chief Qasem Soleimani, in a Baghdad drone strike.
In a meeting between Iran's President Hassan Rouhani and the visiting emir of Qatar, both sides agreed de-escalation is the "only solution" to the regional crisis, the emirate's ruler said.
Qatar hosts the largest US military base in the region but also enjoys strong ties with Iran, with which it shares the world's largest gas field.
"This visit comes at a critical time in the region," Emir Sheikh Tamim bin Hamad Al-Thani said on what was believed to be his first official visit to the Islamic republic.
"We agreed... that the only solution to these crises is de-escalation from everyone and dialogue."
For his part, Rouhani said: "Given the importance of security of the region... we've decided to have more consultations and cooperation for the security of the entire region."
Also on Sunday, Hossein Salami, commander of Iran's Revolutionary Guards, said the missiles it fired last Wednesday on Iraqi bases hosting US troops were not aimed at killing American personnel.
"Our aim was not really to kill enemy soldiers. That was not important," he told parliament.
The US said no American personnel were harmed in the attacks.
Across the border in Iraq, the military said rockets slammed on Sunday into Al-Balad, an Iraqi airbase where US forces have been stationed, wounding two Iraqi officers and two airmen.
The base had held a small US Air Force contingent as well as American contractors, but a majority of these personnel had already been evacuated due to the tensions between the US and Iran, military sources told AFP.
There was no immediate claim of responsibility for Sunday's rocket attacks. The US has previously blamed such attacks on Iran-backed groups in Iraq.
The current crisis claimed a tragic toll when Iran - on hair-triggered alert just after attacking the Iraqi bases - last Wednesday accidentally shot down the Ukraine International Airlines plane, killing all 176 people aboard.
After days of denial from Iran, Rouhani on Saturday admitted to "human error" in bringing down the Boeing 737, and the Guards' aerospace commander General Amirali Hajizadeh accepted full responsibility.
On Saturday evening, a memorial at Tehran's Amir Kabir University in honour of those killed turned into a demonstration that AFP correspondents said was attended by hundreds of students.
They shouted "death to liars" and demanded the resignation and prosecution of those responsible, Fars news agency reported, saying that police "dispersed" them.
Around the same time, police temporarily arrested the British ambassador, Rob Macaire, who had attended the vigil, sparking a fresh diplomatic crisis.
Macaire tweeted Sunday: "I wasn't taking part in any demonstrations! Went to an event advertised as a vigil for victims of #PS752 tragedy.
"Normal to want to pay respects -- some of victims were British. I left after 5 mins, when some started chanting."
Fars said Macaire was summoned on Sunday to Iran's foreign ministry for his "presence in illegal gatherings".
"The Islamic Republic of Iran's official protest was conveyed to him and to the British government," it said, citing the ministry.
Later on Sunday up to 200 protesters rallied outside the British diplomatic mission, chanting "Death to Britain" and burning a Union Jack.
Iran's supreme leader Ayatollah Ali Khamenei on Sunday called for countries in the region to bolster ties to overcome turbulence caused by the presence of the US and its allies.
"The current situation... demands - more than ever before - strengthening of relations between countries in the region as well as avoiding influence of foreigners'" meddling, Khamenei was quoted as saying on his official Twitter account as he hosted Qatar's emir.
Elsewhere in Tehran, tensions appeared to be mounting again, with a heavy police presence notably around the iconic Azadi Square south of the centre.
Riot police armed with water cannon and batons were seen at Amir Kabir, Sharif and Tehran universities as well as Enqelab Square.
Around 50 Basij militiamen brandishing paintball guns, potentially to mark protesters to authorities, were also seen near Amir Kabir.