Turkish Prime Minister said that 2,839 soldiers and officers implicated in an overnight coup attempt have been arrested. At least 265 people have been killed, including 104 pro-coup participants, while 1,440 people were injured in military action in Istanbul and Ankara.

According to Prime Minister Binali Yildirim, those arrested included ordinary soldiers and high-ranking officers. He added that about 20 of those who planned the overnight coup were killed and 30 more were wounded.

Acting chief of staff of the armed forces Umit Dundar said during a press conference that more than 190 people have been killed since the attempted coup was launched.

“1,563 soldiers were arrested, and 104 military who took part in the coup were killed in clashes. Ninety others were also killed, including 41 [pro-government] police officers, 2 [pro-government] soldiers and 47 civilians,” he said.

Pro-government forces have seized control of the top military HQ building, but there are still some groups of rebels resisting, a Turkish official said on Saturday, as cited by Reuters.

General Hulusi Akar, who heads Turkey’s armed forces, has been rescued from rebel captivity. He was the most senior military official in their hands.

The rebels reportedly have several helicopter gunships in their disposal, but loyalists have threatened to shoot them down as they downed at least one aircraft carrying out attacks on government buildings.

A faction of the Turkish military attempted to overthrow the government on Friday night, employing tanks and attack helicopters. The conspiracy appears to have failed, however, as they didn’t manage to capture any senior government officials and couldn’t win wide support from the Turkish military.

President Recep Tayyip Erdogan called on his civilian supporters to take to the streets of Istanbul, which they did. Rebel soldiers, who called on the population to stay indoors, apparently didn’t have the resolve to launch a full-scale war against civilians in Turkey’s biggest city.

The coup attempt began on Friday night when warplanes and helicopters buzzed over Ankara and rebel troops moved in to seal off the bridges over the Bosphorus Strait.

Tanks attacked several government buildings, including the Turkish parliament, as lawmakers hid in shelters inside the building.

Several airports were shut down and access to social media was blocked in the first hours of turmoil.

The TRT state television and the Turkish branch of CNN were seized and ceased broadcasting.

Government officials accused Fethullah Gulen, an influential cleric in self-imposed exile in the United States, of instigating the plot. Gulen used to be an ally of Erdogan, but turned into his fierce opponent.

In 2013, Turkey was shaken by a corruption scandal involving senior government figures. Erdogan claimed it had been set up by Gulen and launched a crackdown on his supporters in the police and judiciary.

Even though Erdogan appears to have kept his hold on power, the coup attempt is a clear signal that some of his policies are badly failing, Sreeram Chaullia from the Jindal School of International Affairs told RT.

Under his watch, Turkey has picked a fight with Kurdish insurgents, contributed to the chaos in Syria and Iraq, antagonized Iran and Russia, and to some extent made Turkey a liability to NATO, he explained.

“I have a feeling that this coup is linked to the security crisis. A series of terrorist attacks signal the inability of the Turkish government to stop these attacks. It has angered some sections of the security establishment that believe that they can do a better job because Erdogan is just playing politics with everything,” he said.

Modern Turkey has undergone three successful military coups over its century-long history, the latest in 1980.

The Turkish military has traditionally been the guarantor of the country’s secularity, while Erdogan’s platform is Islamist in nature. Critics accuse the Turkish president of trying to turn the country into an Islamic state with him as its dictatorial head.

Erdogan, who has been in power since 2002, has faced being toppled by the military before, but the alleged plot dubbed Operation Sledgehammer was prevented in 2010 by a series of arrests. Some 300 alleged conspirators were sent to prison at that time.

Turkey is a member of NATO and a key US ally in the region, providing its airbase for the ongoing military campaign in neighboring Syria. It also hosts American nuclear weapons, with an estimated 50 to 90 B61 bombs stored at the Incirlik base.