Qatar's Emir Sheikh Tamim bin Hamad Al Thani said the only solution to rising tensions in the Middle East between Iran and the United States was de-escalation and dialogue.

Sheikh Tamim's visit on Sunday to Iran to meet President Hassan Rouhani, its supreme leader, and other senior leaders came amid heightened tensions in the Gulf following the US assassination of top Iranian commander Qassem Soleimani in Baghdad and Iran's retaliatory missile strikes on US targets in Iraq.

Qatar and Iran agreed that de-escalation was the "only solution" to regional tensions, Sheikh Tamim said after meeting Rouhani.

"This visit comes at a critical time in the region, and we agreed with the brothers and with His Excellency the president that the only solution to these crises is de-escalation from everyone and dialogue," he told a news conference.

"Dialogue is the only solution" to resolve the crisis, he added.

Sheikh Tamim was the first national leader to come to Iran since Soleimani's killing on January 3 in an American drone strike.

Qatar is one of a few countries in the region that maintains a close relationship with Washington and Tehran.

More:

At the joint news conference, Rouhani stressed the importance of stability in the region.

"Considering the importance of regional security - especially in the waterways in the Persian Gulf, the Strait of Hormuz and the Sea of Oman - we decided to have more talks and cooperation for the security of the whole region," said the Iranian president.

Iran's Supreme Leader Ayatollah Ali Khamenei called on Sunday for increased cooperation among countries in the region to deal with problems he blamed on the United States, his official website said.

"The current situation in the region 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.

"The reason for the current turbulent situation in our region is the corruptive presence of the US and its cohorts. The only way to confront this is to depend on cooperation within the region," he said.

Marwan Bishara, Al Jazeera's senior political analyst, said Sheikh Tamim's efforts to calm tensions were unique.

"Hardly any country or leader in the region is able to make this kind of visit, while at the same time maintaining relations with the American, European, and Iraqi leadership - trying to bridge ideas and facilitate dialogue," he said.

Qatar's emir departed Iran on Sunday evening, state-run Qatar News Agency (QNA) reported.

'Mutual concern'

QNA earlier said the talks in Iran will focus on "bilateral relations between the two countries and ways of promoting and enhancing them, as well as the latest developments in the region and ... international issues of mutual concern".

Qatar, which is close to the US but also has strong ties with Iran, with which it shares the world's largest gas field, has called for a peaceful solution to regional tensions.

Sheikh Tamim was accompanied by an official delegation on his first trip to Iran since becoming emir in 2013.

Earlier on Sunday, the Qatari emir headed to Oman's capital, Muscat, where he offered his condolences to the Gulf state's new sultan, Haitham bin Tariq Al Said, for the death of his predecessor, Sultan Qaboos bin Said Al Said.

Emir of Qatar will be in Tehran shortly for the first time and meeting with Iranian President Hassan Rouhani #SoleimaniAassination #emirofqatar #AlJazeeraEnglish — Dorsa Jabbari (@DorsaJabbari) January 12, 2020

'Reduce escalation'

A day after the January 3 killing of Soleimani, the head of the overseas wing of the elite Islamic Revolutionary Guard Corps, Qatari Foreign Minister Sheikh Mohammed bin Abdulrahman Al Thani met his Iranian counterpart, Mohammad Javad Zarif, in Tehran.

The two officials discussed the latest developments in the region, "especially the events in Iraq as well as ways of calm to maintain collective security of the region," QNA reported at the time.

On Wednesday, Sheikh Mohammed said Qatar was closely following developments in Iraq and seeking to coordinate with friendly countries to reduce tensions.

"We seek through a series of communications to consult and coordinate with friendly and brotherly countries to calm and reduce escalation," he wrote on Twitter.