The Iranian and Saudi foreign ministers met Sunday in New York, with their rival states brought together by their opposition to the Islamic State jihadist group, the Iranian government said.

"This is a new page in relations between the two countries," Iran's Mohammad Javad Zarif said, quoted on the government's website.

"We hope this will have a positive impact on restoring peace and security in the region and the world, and for the interests of all Muslim nations," he said after the talks.

His Saudi counterpart Prince Saud al-Faisal, referring to the Islamic State's onslaught in Iraq and Syria, was quoted as saying: "We believe we must avoid the errors of the past to successfully confront the current crisis."

Iran and Saudi Arabia are "influential in the region and common cooperation will undeniably have an effect on restoring peace."

The encounter in New York, where the foreign ministers were to attend the U.N. General Assembly, was the first between the top diplomats of Saudi Arabia and Iran since Iranian President Hassan Rouhani came to power in August 2013.

Predominantly Shiite Iran and mainly Sunni Saudi Arabia, rivals across the Gulf, are on opposite sides in the Syrian conflict, with Tehran backing President Bashar Assad and Riyadh supporting the rebels trying to topple him.

Tehran also supports protests by Bahrain's Shiite majority while Riyadh backs its Sunni rulers, and Saudi Arabia is concerned about Iran's nuclear program and over any U.S.-Iranian rapprochement.