ANKARA - The Turkish military on Friday said that it had assumed power over Turkey, in what the prime minister has termed an illegal act.

Armed forces said they had taken over power in the country to protect the democratic order and to maintain human rights. “The power in the country has been seized in its entirety,” said a military statement read on NTV television. The military’s website was not immediately accessible.

A source from the presidential office has told Reuters that President Erdogan is “safe”. But according to another Turkish news agency, the military has detained the civil leadership.

Gunfire has been reported in the Turkish capital as military jets have been seen flying over Turkish capital. Witnesses also said they have seen helicopters above the city.

In a statement sent by email and reported on Turkish TV channels, the military said all of Turkey’s existing foreign relations would be maintained and that the rule of law would remain the priority.

Turkey’s prime minister said earlier a faction within the army had attempted to seize power but that they would be pushed back and that it was wrong to call it a coup. Those behind the attempted coup would pay the highest price, he added.

There were reports that Turkey’s top general and some other officers were being ‘held hostage’ at military HQ. “General Hulusi Akar has been taken hostage by a group in the military who attempted an uprising,” the state-run Anadolu news agency reported citing “credible sources”.

All flights from Istanbul’s Ataturk Airport have been cancelled, a Reuters witness said on Friday, citing a pilot, after the military said it had taken control of the government.

Military tanks have also been reported outside Istanbul’s Atatürk airport.

A Turkish official who did not want to be named said soldiers had been deployed in other cities in Turkey, but did not specify which ones.

Dogan News Agency reported the national police directorate had summoned all police to duty in Ankara.

Media reports said ambulances were seen in front of Turkey’s military headquarters.

Meanwhile, two intercontinental bridges in Istanbul—the Bosphorus and Fatih—were closed by members of Turkey’s army. The bridges connect Turkey’s European section to its Asian side.

Internet users within Turkey have also reportedly been blocked from Twitter, Facebook, and other social media sites.