The foreign ministers of Iran and Saudi Arabia met over the weekend, Iran said Monday, in the first talks between senior officials from the countries since they broke diplomatic ties 2 1/2 years ago.

The official Islamic Republic News Agency said that during Sunday's meeting in New York the diplomats discussed restoring diplomatic relations and traded views on the Persian Gulf crisis.Ties were severed in a dispute over the number of Iranians allowed to attend the annual Moslem pilgrimage to holy sites in Saudi Arabia after several violent incidents during pilgrimages that the Saudis said were incited by Iran's fundamentalist leaders.

The IRNA dispatch said the meeting between Ali Akbar Velayati of Iran and Prince Saud al-Faisal of Saudi Arabia took place at U.N. headquarters. The ministers were in New York for a global summit on children.

IRNA quoted Velayati as telling Prince Saud that the main obstacle to resumption of relations was the dispute over the number of Iranians allowed into Saudi Arabia to worship at Islam's holiest shrines at Mecca and Medina.

The Iranian agency quoted Prince Saud as saying his government is eager to resolve this issue before the next pilgrimage in June. The agency said Prince Saud "promised that his government will do its best so that Iranian Moslems perform their rituals in a suitable matter."

In 1987, violent riots in Mecca killed 402 people. Most victims were Iranians defying Saudi orders that ban political rallying during the pilgrimage season.