ISTANBUL - Turkish President Tayyip Erdogan leapt to the defence of an Ottoman military commander on Wednesday after the United Arab Emirates foreign minister retweeted accusations that Ottoman forces looted the holy city of Medina during World War One.

Erdogan appeared to be responding to a tweet shared on Saturday by UAE Foreign Minister Sheikh Abdullah bin Zayed Al Nahayan, which said Ottoman troops led by Fakhreddin Pasha stole money and manuscripts from Medina in 1916.

The tweet also said Turkish forces abducted residents of Medina and took them to Istanbul. "These are Erdogan's ancestors, and their history with Arab Muslims," read the tweet, originally posted by someone identifying themselves as an Iraqi dentist from Germany.

Medina, now part of Saudi Arabia, was part of the Ottoman territory for centuries until the empire's collapse at the end of World War One.

In a speech to local administrators, Erdogan said Fahreddin Pasha had not stolen from Medina or its people, but strived to protect the city and its occupants during a time of war.

"Those miserable people who are delirious enough to shamelessly and tirelessly say Erdogan's ancestors stole sacred items from there and brought them to Istanbul - it was to protect them from the people that came to invade," he said.

The United Arab Emirates, a close U.S. ally, sees Erdogan's Islamist-rooted ruling party as a friend of Islamist forces which the UAE opposes across the Arab world.

Relations were further strained by Ankara's support for Qatar after Saudi Arabia, the UAE, Bahrain and Egypt imposed sanctions on the Gulf emirate in June.

Two months later, Sheikh Abdullah criticised what he called Turkey and Iran's "colonial" actions in Syria, even though Turkey and the UAE have both opposed Syria President Bashar al-Assad.

Erdogan's spokesman Ibrahim Kalin has also responded to Sheikh Abdullah's comments, saying it was a shame that he "retweets this propaganda lie that seeks to turn Turks & Arabs against one another, again."

"Is attacking President Erdoan at all costs the new fashion now" Kalin tweeted on Tuesday.

(Writing by Ali Kucukgocmen; Editing by Dominic Evans) ((ali.kucukgocmen@thomsonreuters.com; Reuters Messaging: Reuters Messaging: ali.kucukgocmen.thomsonreuters.com@reuters.net))