BEIRUT (AP) — Iran’s foreign minister said Thursday that Tehran wants Lebanon's rivals to reach an agreement to elect a new president in the crisis-hit country that has been without a head of state since October.

Hossein Amirabdollahian made his comments during his first visit to Lebanon since Iran and Saudi Arabia reached an agreement in China last month to re-establish diplomatic relations and reopen embassies after seven years of tensions that had major repercussions in the tiny Mediterranean country.

The agreement negotiated with China lowers the chance of armed conflict between the Mideast rivals — both directly and in proxy conflicts around the region. The effects of the agreement include eased tensions and an exchange of prisoners between Saudi Arabia and Yemen's Iran-backed rebels, as well as improved relations between Saudi Arabia and Syrian President Bashar Assad.

Lebanese groups are deeply divided between an Iran-backed coalition led by the powerful Hezbollah group and a Western and Saudi-backed alliance. The deep divisions in Lebanon have left the country without a president since the term of President Michel Aoun ended in late October.

Speaking during a joint news conference with Amirabdollahian, Lebanese caretaker Foreign Minister Abdallah Bouhabib told reporters, “I am optimistic that every regional agreement and any deal between regional countries is good for Lebanon.”

“The agreement between Iran and Saudi Arabia is important for peace in the region,” Bouhabib said. He did not elaborate.

Amirabdollahian said Iran encourages all sides in Lebanon to speed up the elections process.

“We will back any election and any agreement that is reached between parties in Lebanon regarding the electing of a president,” Amirabdollahian said before heading to a meeting with caretaker Lebanese Prime Minister Najib Mikati.

Hezbollah’s ally Sleiman Frangieh and army commander Gen. Joseph Aoun, are the top candidates for president. Lebanon’s parliament held about a dozen sessions over the past months but failed to elect a head of state amid deep divisions.

The largest Christian blocs in parliament have rejected the election of Frangieh and there have been reports in local media that Saudi Arabia is opposed to him becoming president.

On Wednesday, Frangieh gave a long TV interview in which he said that if he is elected president, he will work for better relations between Lebanon and Saudi Arabia. Frangieh also added that his close relations with Hezbollah and Assad could be used for the good of Lebanon.

Copyright 2023 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.