Government says coup attempt foiled as explosions continue to be heard in central Istanbul and Ankara.
Turkish President Recep Tayyip Erdogan appeared early on Saturday among a crowd of supporters at Istanbul's main airport, footage broadcast on local media showed, hours after an attempt by an army faction to topple the government.
Erdogan's arrival in Istanbul came after Prime Minister Binali Yildirim told broadcaster NTV on Saturday that the situation in Turkey was "largely under control".
In comments broadcast by Turkish media, Erdogan said those involved in the coup would receive the necessary response, no mater what institution they were from.
Earlier, thousands of people had heeded a call from the president to take to the streets and protest against the attempted coup.
'Foiled coup'
Late on Friday, sections of the army had officially declared a coup and martial law, saying they had "taken control of the country" as Istanbul's main airport was closed and fighter jets were seen in the skies.
Turkey's intelligence agency MIT was targeted by hijacked helicopters but the coup attempt was "foiled", its spokesman told NTV television.
Yildirim also told NTV that a no-fly zone had been declared over the capital, Ankara.
The broadcaster also reported that nearly 50 soldiers had been arrested.
However, even as the announcement by Yildirim came, at least two loud explosions were heard in central Istanbul, apparently emanating from neighbourhoods close to Taksim Square.
There were also reports of an explosion at the parliament building in the capital, Ankara.
Source: Al Jazeera and agencies
In an unsuccessful  attempt apparently by elements of the Turkish  in Istanbul and Ankara, 265 people were killed and 1440 were injured, Turkish Prime Minister  reported on Saturday. Following the incident, 2,839 soldiers and officers were detained and, according to another military official, 104 coup plotters were killed. General , held by the rebels, was later freed.
File photo of Recep Tayyip Erdoğan, 2016.  
On Friday, the rebels declared martial law claiming to have "taken control of the country" and said Turkish president Recep Tayyip Erdoğan's government was responsible for damaging Turkey's secular tradition. They shut down Istanbul Atatürk Airport and blocked the two bridges over the , with gunfire and, by some reports, jets dropping bombs in Istanbul and Ankara. Social-networking websites were blocked in the country and news channel CNN stopped broadcasting. Tank fire and explosions were reported at the parliament.

Prime Minister Yıldırım declared a no-fly zone over Ankara. Erdoğan was in  during the coup attempt. Erdoğan after reaching Instanbul on Saturday, said,  as he announced he would remain president.

General Zekai Aksakalli told , "Those who are attempting a coup will not succeed. Our people should know that we will overcome this". Erdoğan supporters were seen carrying the Turkish flag on the streets of Istanbul.

During Erdoğan's address to citizens, coup supporters were seen surrendering, abandoning military tanks, given citizen opposition to the coup. Eight people fled the country seeking asylum in the Greek city of , according to Greek officials.

Officials claimed , who is currently in the United States on an exile, was responsible for the coup;  reported Gülen condemned the attempt.