Turkey has arrested 11 fugitive soldiers suspected of involvement in an attack on President Recep Tayyip Erdogan's hotel during the night of the failed coup, the deputy prime minister said today.

Erdogan was staying in the western seaside resort of Marmaris on July 15 but dashed to Istanbul just before the hotel came under attack from rebel soldiers determined to oust him from power.

"Eleven of them were captured in Ula," Deputy prime minister Numan Kurtulmus told a press conference after a cabinet meeting, referring to a town near Marmaris. He said one soldier was still at large.

Erdogan earlier said his swift escape had saved him from being killed or taken hostage. An interior ministry official, who declined to be named, described the arrested men as members of a "death squad" and said the overnight operation to catch them followed a tip-off from local villagers.

The soldiers had been hiding in the wild landscape above Marmaris since the military action, and the villagers spotted them while they were out boar-hunting.

"There was an exchange of fire during the operation," the official added. "Drones and helicopters were used to pinpoint the location."

Since the coup, Erdogan has launched a massive purge of Turkish institutions, especially the military, with more than 3,000 armed forces personnel dismissed.