By William Maclean

DUBAI, May 24 (Reuters) - Qatar said hackers posted fake remarks by its Emir criticising U.S. foreign policy on Wednesday in what diplomats said appeared an attempt to portray the Gulf state as an unreliable ally too close to Islamist militants.

In an unusual twist, other Gulf Arab countries including oil giant Saudi Arabia permitted their state-backed media to run the remarks attributed to Sheikh Tamim bin Hamad al-Thani on Qatar's official news agency even after Doha had issued a robust denial.

The development risked reviving a 2014 rift between Qatar and other Gulf states over Doha's backing for Islamists, and suggest behind-the-scenes disarray among U.S. Gulf allies just days after a visit by President Donald Trump to the region.

Disputes between Gulf Arab states can have significance far beyond their energy rich region.

Qatar, Saudi Arabia and the United Arab Emirates have used their oil and gas revenues to influence events in other Middle Eastern countries, and rifts between them can alter the political environment in Libya, Egypt, Syria, Iraq and Yemen.

The hacked report said Sheikh Tamim, in a speech to a military graduation ceremony, was critical of renewed tensions with Tehran, expressed understanding for Hezbollah and Hamas, and suggested Trump might not last long in power.

A government spokesman told Reuters the Emir had attended a graduation ceremony for Qataris doing national service, "however, he did not make any speech or give any statements".

"ORCHESTRATED BARRAGE"

"The Qatar News Agency (QNA) website has been hacked by an unknown entity. A false statement attributed to His Highness has been published," a government statement said, adding authorities would investigate and hold all those involved accountable.

The incident happened days after Qatar complained it was the target of "an orchestrated barrage" of criticism by unknown parties in the run-up to Trump's visit alleging the Gulf state supported militant groups in the Middle East.

Authorities in Saudi Arabia and the United Arab Emirates (UAE) blocked the main website of Qatar's al Jazeera television, which Riyadh and Abu Dhabi have often seen as being critical of their governments. Al Jazeera says it is an independent news service giving a voice to everyone in the region.

"Qatar splits the rank, sides with the enemies of the nation," thundered Saudi Arabia's Okaz daily.

Riyadh's Arab News said the comments sparked "outrage" among other Gulf states.

The falling out is especially awkward for the Gulf Arab states after their leaders met Trump last weekend at a Riyadh summit of Muslim nations meant to showcase solidarity against Sunni armed militant groups and Shi'ite regional adversary Iran.

In Riyadh Trump renewed his assertion that Iran was a leading state sponsor of terrorism. Iran denies that and says Saudi Arabia, the dominant GCC power, supports militant Islamist armed groups such as al Qaeda and Islamic State. Riyadh, in turn, denies that accusation.

Ties between Qatar and other Gulf Arab states suffered an eight-month breach in 2014 over Qatar's alleged support for the Muslim Brotherhood, an Islamist group whose political ideology challenges the principle of dynastic rule. (Reporting by Mostafa Hashem, Sami Aboudi, Sylvia Westall, Noah Browning, Writing by Maha El Dahan and William Maclean; Editing by Richard Lough).

© Reuters News 2017