ANKARA, Turkey | The purging of thousands of alleged plotters of a failed coup raised tensions Monday between Turkey and the West, with U.S. and European officials urging restraint, while Ankara insisted that Washington extradite an exile accused of orchestrating the plot.

Authorities have fired nearly 9,000 police officers, bureaucrats and others, while detaining thousands more alleged to have been involved in Friday night’s attempted coup, the state-run Anadolu news agency reported.

Former air force commander Akin Ozturk, alleged to be the ringleader of the uprising, was put under arrest following questioning by a magistrate along with 25 other suspects, the news agency said. Ozturk, who has denied involvement and insisted he had tried to suppress the rebellion, appeared in video from Turkish TV looking bruised with a bandage over his ear.

President Recep Tayyip Erdogan refused to rule out bringing back the death penalty, telling the U.S. cable TV station CNN in an interview via a government translator, “There is a clear crime of treason.” He added that it would be up to parliament to decide.

“If they accept to discuss it then I as president will approve any decision that comes out of the parliament,” he said. He said Turks have been calling for the reinstatement of the death penalty because of the increased terror attacks and demand for swift justice.

Anadolu said 8,777 employees attached to the Interior Ministry were dismissed, including 30 governors, 52 civil service inspectors and 16 legal advisers. Other media reports said police, military police and members of the coast guard also were removed from duty.

During the uprising by a faction of the military, warplanes fired on government buildings and tanks rolled into the streets of major cities before the rebellion was put down by forces loyal to the government and pro-Erdogan civilians who took to the streets. The top brass did not support the coup.

Erdogan told CNN that he escaped death by only a few minutes before coup plotters stormed the resort in southwest Turkey where he was vacationing last weekend when the coup unfolded.

He said soldiers supporting the coup killed two of his bodyguards when they stormed the resort early Saturday.

“Had I stayed 10, 15 additional minutes, I would have been killed or I would have been taken,” he told CNN.

Revealing new details of the night of the coup, Erdogan said the renegade soldiers were in control of the command and control towers at Istanbul’s Ataturk International Airport for hours before forces loyal to the president were able to regain control. He said that about 10,000 supporters were at the airport to greet him when his plane landed.

He also said that power was shut off at all military bases, including the Incirlik air base in southern Turkey used by the U.S.-led coalition jets fighting the Islamic State group, because the military didn’t want to risk having the conspirators use them.

Prime Minister Binali Yildirim said 232 people — 208 government supporters he called “martyrs,” as well as 24 coup plotters — died in the unrest. His voice cracked and he wept as he spoke with reporters after a Cabinet meeting and repeated a question his grandson had put to him: “Why are they killing people?”

He said he had no answer, but that Turkey would make the coup plotters answer “in such a way that the whole world will see.”

As Western officials expressed alarm at the rapid roundup of so many by their key NATO ally, Turkish government officials explained that the plotters in the military had been under investigation and launched their ill-planned operation out of panic.

The swift move against so many reflected the prior investigation, the government said. It alleged the coup conspirators were loyal to moderate cleric Fethullah Gulen, a former Erdogan ally who lives in exile in Saylorsburg, Pennsylvania, and espouses a philosophy that blends a mystical form of Islam with democracy.

Erdogan has often accused Gulen of trying to overthrow the government, and Turkey has demanded his extradition, labeling his movement a terrorist organization and putting him on trial in absentia. Gulen strongly denies the government’s charges and has suggested that Friday’s attempted coup could have been staged, as a pretext for the Erdogan government to seize even more power.

U.S. officials have said that the U.S. will consider extraditing Gulen, if the Turkish government offers evidence that he was involved in the plot or committed crimes. White House Press Secretary Josh Earnest said the U.S. would follow procedures in a decades-old extradition treaty and called Turkish charges that the U.S. was harboring Gulen “factually incorrect.”

Erdogan said an official formal request will be conveyed to the United States demanding the extradition of Gulen.

“Even if he is a citizen of the U.S., the U.S. should not keep such a terrorist,” Erdogan told CNN.He said if Gulen is on Turkey’s terrorist list that should be enough for the U.S. to extradite him.

Yildirim said the normal U.S. legal processes would not be good enough.

“We would be disillusioned and would question our friendship if our friends were to say to us ‘Show us the evidence.’ despite all the efforts … to eradicate the elected government and the national will of a country,” he said, while adding that the Justice Ministry was preparing documents to send to the United States.

Over the weekend, Turkey responded to the coup attempt by rounding up some 6,000 people, including hundreds of judges and prosecutors.

Reacting to the large number of arrests in the military and the judiciary, as well as Erdogan’s suggestion that Turkey could bring back the death penalty, Western officials were urging Turkey to maintain the rule of law.

Earnest said President Barack Obama would call Erdogan soon to reiterate U.S. support for Turkey’s democratically elected civilian government and make the case for restraint and respect for the freedoms enshrined in the Turkish constitution.

EU foreign policy chief Federica Mogherini said at a news conference with U.S. Secretary of State John Kerry that the coup “is no excuse to take the country away from fundamental rights and the rule of law, and we will be extremely vigilant on that.”

Kerry added that Turkey must “uphold the highest standards for the country’s democratic institutions and the rule of law.”

While he recognized the need to apprehend the coup plotters, Kerry said: “We caution against a reach that goes beyond that.”

Mogherini said the talks on Turkey’s bid to join the European Union would end if Ankara restores the death penalty. That message was echoed by Germany, the EU’s biggest state.

“The institution of the death penalty can only mean that such a country could not be a member,” Steffen Seibert, spokesman for Chancellor Angela Merkel, said in Berlin.

NATO Secretary-General Jens Stoltenberg, who said he spoke to Erdogan, praised the Turkish people for showing “great courage,” but he also said it was essential for the alliance member to “ensure full respect for democracy and its institutions, the constitutional order, the rule of law and fundamental freedoms.”

For the fourth night in a row, hundreds took to public squares in major cities, including Istanbul, Ankara and Izmir, in a fresh show of support for the government. They waved Turkish flags, shouted pro-government slogans and sang praise of Erdogan.

Mostafa Minawi, director of the Ottoman and Turkish Studies Initiative at Cornell University, called the failed coup “a gift for President Erdogan, given him all the justification he needs to implement further clamp down measures against any dissenters, in the process sinking Turkey deeper into authoritarianism.”