Pakistan's Interior Minister Mohsin Naqvi is visiting Iran to discuss regional security and stability, the foreign office confirmed Wednesday, as Islamabad seeks to help resolve the Middle East war.

Naqvi, previously involved in mediation efforts between Iran and the U.S., is known to be close to the powerful head of the Pakistani military, Asim Munir.

Iranian state news agency IRNA reported late Tuesday that Naqvi met with Iranian President Masoud Pezeshkian, Foreign Minister Abbas Araghchi and Interior Minister Eskandar Momeni.

"He is discussing bilateral relations, security, regional security and stability, and constructive engagement amongst the parties in the region and regional developments," Pakistani Foreign Ministry spokesperson Tahir Andrabi told reporters in Islamabad.

The Iranian government's website said Naqvi conveyed to Pezeshkian "a message from the Pakistani prime minister and the chief of the army," without specifying its content.

Tehran insists on retaining control of the Strait of Hormuz after the war and wants to charge fees for passage, repeatedly striking ships it accuses of attempting to circumvent its preferred route. The U.S. has imposed a rival blockade on Iranian ports.

Attacks in the waterway, which was free to transit before the war, led to the collapse of an April cease-fire and mediators have urged both sides to return to the terms of a subsequent June memorandum that set out a path for peace talks.

Last week Iran said it had agreed a route with neighboring Oman for ships transiting the strait and was finalising arrangements for jointly managing the strategic waterway.

On Tuesday, the U.S. military announced that it had fired on a Panama-flagged cargo ship that attempted to break the American blockade of Iran's ports.