CAIRO, May 24 (Reuters) - Qatar said on Wednesday its official state news agency had been hacked and false statements attributed to its ruler had been posted.

The statement was made on the official news agency's Twitter account, which asked the media not to publish the remarks that had been posted earlier.

A story had run earlier on the agency's website quoting a speech by Sheikh Tamim bin Hamad al-Thani, Qatar's ruler, on his country's relations with U.S. President Donald Trump and Iran, amongst other topics.

Qatar said it was investigating the incident and everything that had been published was completely false.

(Reporting by Mostafa Hashem; Writing by Maha El Dahan; Editing by Sandra Maler) ((Maha.Dahan@thomsonreuters.com; + 9712 4082101; Reuters Messaging: maha.dahan.thomsonreuters.com@reuters.net))