DUBAI/ROME - Iran’s navy warned a US warship on Wednesday to leave waters near the Strait of Hormuz where the Iranians were testing submarines, destroyers and missile launchers, news agencies reported.

The commander of Iran’s fleet, Rear-Admiral Habibollah Sayyari, told Tasnim news agency the US ship was trying to collect information in the Sea of Oman - an area close to the Strait, a vital oil and gas shipping route - and said it left quickly after the alert. There was no immediate reaction from Washington which this month joined other world powers in lifting sanctions on the Islamic Republic after Iran agreed to curtail its nuclear programme. In the days before that deal, Iran briefly detained 10 US sailors after their boats entered its waters because of what they said was a navigational error. Iranian President Hassan Rouhani said on Wednesday that the United States cannot solve any problems in the Middle East without Iran’s help and should drop its “hostile” stance towards Tehran,.

On his first official visit to Europe, Rouhani also took a swipe at regional arch rival Saudi Arabia, saying its military campaign in neighbouring Yemen was a failure and a frustration. Rouhani is midway through a four-day trip to Italy and France, looking to burnish his country’s international credentials following the signing last year of a nuclear accord with world powers and the lifting of financial sanctions.

While EU firms are lining up to sign lucrative business deals, the United States is keeping some of its sanctions in place, accusing Tehran of funding what it considers to be terror groups, and ties between the two nations remain terse.

“It’s possible that Iran and the United States might have friendly relations. But the key to that is in Washington’s hands, not Tehran’s,” Rouhani told a news conference, saying he would be happy to see US businessmen in Iran.

“I would like to see the Americans set aside their hostility and chose another way, but inside the US there are some problems, there is no unified voice,” he said, noting that “the Zionist lobby” was “very influential”.

He also rejected accusations that Iran was funding terror organisations. “It is clear that Iran is a country opposed to terrorism and a country that fights terrorism,” he said.

The United States is the dominant foreign power in the Middle East, sporting close ties with Saudi Arabia, Egypt and Israel, and is militarily involved in both Iraq and Syria, where it is battling militant group, Islamic State.

“The Americans know very well that when it comes to important regional issues they cannot achieve anything without Iran’s influence or say,” Rouhani said, speaking through a translator.

Adding to tensions in the region is the recent deterioration in relations between Iran and Saudi Arabia. Riyadh broke off diplomatic ties with Tehran this month in an escalating row over the Saudi execution of a Shia Muslim cleric.

Rouhani said Saudi was acting out of frustration, branding its 10-month military campaign in Yemen against the Houthi militia, who are allied to Iran, as a flop.

“It is angry because of its failures,” he said. “Saudi Arabia has been bombing the impoverished people of Yemen for 10 months and has not achieved anything. It has not had any victory and is hated more than ever by the Yemeni people.”