"Some people illegally undertook an illegal action outside of the chain of command," Yildirim said in comments broadcast by private channel NTV, Reuters wrote.
"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.
Read alsoRussian military ship with camouflaged tanks traverses Istanbul’s Bosphorus: mediaFootage 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.