DUBAI- Saudi Arabia and Iraq have agreed to cooperate in security and intelligence matters, Saudi-owned Al Arabiya television cited Iraqi Foreign Minister Mohammed Ali al-Hakim as saying, as Riyadh woos Baghdad to stem the influence of regional rival Iran.

Iraq has previously been closer to Iran, the main Shi'ite power in the Middle East and Saudi Arabia's arch-rival for influence.

The announcement came during a state visit by an Iraqi delegation to Saudi Arabia led by Iraqi Prime Minister Adel Abdul Mahdi.

Abdul Mahdi met Saudi Arabia's Crown Prince Mohammed bin Salman, his office said on Thursday, a day after his first official visit to the kingdom. 

The meeting with the crown prince came after he met King Salman on Wednesday. His office said the leaders signed 13 agreements in areas such as trade, energy and political cooperation, without giving further details.

(Reporting by Maher Chmaytelli; Writing by Tuqa Khalid; Editing by Hugh Lawson) ((Tuqa.Khalid@thomsonreuters.com; +971521047568;))