Turkey's military incursion into Syria to relocate a tomb surrounded by Islamic State (IS) militants and evacuate the soldiers guarding it was a temporary move to safeguard their lives and not a retreat, President Tayyip Erdogan has said.

The action, which involved tanks, drones and reconnaissance planes as well as several hundred ground troops, was the first of its kind by the Turkish army into Syria since the start of the civil war there nearly four years ago.

"The Suleyman Shah tomb operation is not a retreat, it is a temporary move in order not to risk soldiers' lives," Mr Erdogan said.

"The game of those who tried to use the tomb and our soldiers to blackmail Turkey has been disrupted."

The Syrian government described the operation as an act of "flagrant aggression", a response dismissed by Mr Erdogan's spokesman Ibrahim Kalin, who said the Syrian authorities had lost all legitimacy.

The 38 soldiers who had been guarding the tomb of Suleyman Shah, grandfather of the founder of the Ottoman Empire, were brought safely home in Saturday's night's operation.

Normally, the detachment is rotated every six months but the last one was trapped for eight months by IS fighters.

The tomb, on a site within Syria that Ankara considers sovereign territory as agreed in a 1921 treaty, is being relocated close to the Turkish border. Suleyman Shah's remains were taken to Turkey in the meantime.