TurkishCoup1
Police officers stand guard near the Turkish military headquarters in Ankara, Turkey, July 15, 2016. REUTERS/TUMAY BERKIN

A group within Turkey's military has attempted to overthrow the government and security forces have been called in to "do what is necessary," Prime Minister Binali Yildirim said on Friday.

"Some people illegally undertook an illegal action outside of the chain of command," Yildirim said in comments broadcast by private channel NTV.

"The government elected by the people remains in charge. This government will only go when the people say so."

Those behind the attempted coup would pay the highest price, he added.

Footage on local television channels showed military vehicles blocking bridges over the Bosphorus in Istanbul and tanks deployed at the city's main airport. In the capital Ankara, warplanes and helicopters roared overhead. A Reuters journalist heard gunshots.

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.