ISTANBUL - A major summit aimed at overcoming differences in the Muslim world condemned Iran Friday for supporting terrorism and meddling in the affairs of other countries.

Iranian President Hassan Rouhani, who had been at the two-day Istanbul conference along with over 30 other heads of state and government from Islamic countries, did not attend the closing meeting in protest at the criticisms.

"The (Organisation of Islamic Cooperation) Conference deplored Iran's interference in the internal affairs of the States of the region and other Member States including Bahrain, Yemen, Syria, and Somalia, and its continued support for terrorism," said the summit's final statement.

It also "condemned Hezbollah for conducting terrorist activities in Syria, Bahrain, Kuwait and Yemen and for supporting terrorist movements and groups undermining the security and stability of OIC Member States".

The Arab League declared Iran's ally Hezbollah a "terrorist" group in March after Gulf kingdoms did the same earlier in the month over the movement's support for the Damascus regime in Syria's war.

There was a security lockdown around the summit venue in Istanbul, the former capital of the Ottoman Empire from where Sultans for centuries ruled Muslims from the Balkans to Arabia.

Turkey has been on high alert following attacks claimed by the Islamic State group and increased violence linked to the Kurdish conflict.

While the summit marked one of Istanbul's most significant gatherings of heads of state for years, some high profile leaders like Jordan's King Abdullah and Egyptian President Abdel Fattah al-Sisi were notable by their absence.

Turkey's relations with Cairo have still not recovered from the 2013 ousting of Islamist president Mohamed Morsi, a close ally of Ankara, while ties with Amman are being tested by differences over Syria.

Turkish President Recep Tayyip Erdogan was on Friday wrapping up a two-day summit of leaders from the world's Muslim countries aimed at narrowing bitter sectarian divisions over crises including the Syria and Yemen conflicts.

He reaffirmed his call for unity at an official dinner late Thursday in the Dolmabahce Palace by the Bosphorus, where the late Ottoman Sultans ruled a decaying empire of Muslim lands that once stretched from from the Balkans to Arabia.

"At this summit, our biggest expectation is for Islamic countries throughout the world to give a message of unity and togetherness to all Muslims," Erdogan told leaders beneath the dome of the vast Muayede Salon, the ceremonial hall where the Sultan would receive visitors.

"Our aim is to give the whole Islamic family hope in the future. God willing, with this summit, a new era will begin for all of us." "Of course the problems in front of us are big. We are going through a tough period. But we should never lose hope," he added.

Erdogan, whose country now holds the chairmanship of the OIC for the next two years, was due to chair the last sessions of the summit Friday before holding a news conference.

The meeting has been marked by signs of a strong emerging alliance between Turkey and fellow Muslim power Saudi Arabia, whose foreign ministers Thursday signed a memorandum on creating a bilateral cooperation council.

Both countries, along with the tiny but gas-rich Gulf state of Qatar, back rebels fighting the regime of President Bashar al-Assad in Syria.

This pits them against Iran and also Russia - with whom Turkey is experiencing a crisis in relations after the downing of a Russian warplane - who are the last major remaining allies of Assad.

Analysts have warned Turkey needs to tread carefully in its alliance with Saudi Arabia, so it is not seen as a sectarian union aimed at Iran.

In a sign of Ankara's desire to maintain a delicate balance, Rouhani is due to begin a bilateral visit to Turkey immediately after the summit.