At least 42 people have been feared killed in clashes in the Turkish capital as groups inside the army attempted against the government of President Recep Tayyip Erdogan, local media reported, citing the prosecutor's office.

A Turkish army tank drives on a street in Ankara.
The casualties included 17 police officers who were killed in Ankara, NTV reported, citing the chief prosecutor's office in the capital's Golbasi district.
It is still very unclear what is happening in Ankara, where rebel soldiers are still said to be firing, and an explosion earlier hit the parliament building.
Erdogan was on vacation and away from both Ankara and Istanbul when the coup began.
He later told CNN Turk by mobile phone the action was "an uprising attempt by a minority member of the military... encouraged by a parallel structure. They will receive an appropriate response."

Turkish soldiers surrender their weapons to policemen during an attempted coup in Istanbul's Taksim Square.
He also called on people to take to the streets to oppose the uprising.
He said, "I urge the Turkish people to convene at public squares and airports. I never believed in a power higher than the power of the people."
Images from the capital show many people -- as well as tanks -- on the streets in scenes of protest and chaos.
After the military takeover was announced, a statement from the group was read out on national broadcaster TRT.
It said that the democratic and secular rule of law had been eroded by the current government. There would be a new constitution, it said.

People stand on a Turkish army tank at Ataturk airport in Istanbul, Turkey.
The statement declared that a "peace council" now ran the country and there would be a curfew and martial law.
However, Turkish Prime Minister Binali Yildirim later claimed that those involved in the coup are now mostly under the control of military senior command -- but that rebel soldiers are still firing in Istanbul and Ankara.
Yildirim said he has received reports that a general, one of those behind the coup, has been killed, and more than 130 others involved have been detained.
By the early hours of Saturday morning, lawmakers were still hiding in shelters inside the parliament building in Ankara, which had been fired on by tanks. Smoke rose up from nearby, Reuters witnesses said. An opposition MP told Reuter's parliament was hit three times and that people had been wounded.

People take cover near policemen as gunfire are heard during an attempted coup in Istanbul's Taksim Square.
A senior Turkish official told Reuters that loyalist forces were gaining control over elements trying to overthrow the government. The official also said that the faction attempting the coup has control of some tanks and has ordered its forces to try to take over streets, but have been unable to do so in many areas.
The source also said security forces are still facing some difficulties in parts of Ankara and Istanbul and that this may continue for the next 24 hours, but will be contained.
Earlier, one of the helicopters being flown by forces involved in the coup attempt was shot down over Ankara.

Turkish military blocks access to the Bosphorus bridge, which links the city's European and Asian sides, in Istanbul
Gunfire and explosions had rocked both the main city Istanbul and capital Ankara in a chaotic night after soldiers took up positions in both cities and ordered state television to read out a statement declaring they had taken power.
But by early Saturday, around 30 pro-coup soldiers were seen surrendering their weapons after being surrounded by armed police in Istanbul's central Taksim square.
They were taken away in police vans as a fighter jet repeatedly screeched overhead at low altitude, causing a boom that shook surrounding buildings and shattered windows.
A coup attempt in Turkey has precedent: Since the creation of the modern Turkish state, there have been four successful military coups.

A Turkish army tank drives on a street in Ankara.
The casualties included 17 police officers who were killed in Ankara, NTV reported, citing the chief prosecutor's office in the capital's Golbasi district.
It is still very unclear what is happening in Ankara, where rebel soldiers are still said to be firing, and an explosion earlier hit the parliament building.
Erdogan was on vacation and away from both Ankara and Istanbul when the coup began.
He later told CNN Turk by mobile phone the action was "an uprising attempt by a minority member of the military... encouraged by a parallel structure. They will receive an appropriate response."

Turkish soldiers surrender their weapons to policemen during an attempted coup in Istanbul's Taksim Square.
He also called on people to take to the streets to oppose the uprising.
He said, "I urge the Turkish people to convene at public squares and airports. I never believed in a power higher than the power of the people."
Images from the capital show many people -- as well as tanks -- on the streets in scenes of protest and chaos.
After the military takeover was announced, a statement from the group was read out on national broadcaster TRT.
It said that the democratic and secular rule of law had been eroded by the current government. There would be a new constitution, it said.

People stand on a Turkish army tank at Ataturk airport in Istanbul, Turkey.
The statement declared that a "peace council" now ran the country and there would be a curfew and martial law.
However, Turkish Prime Minister Binali Yildirim later claimed that those involved in the coup are now mostly under the control of military senior command -- but that rebel soldiers are still firing in Istanbul and Ankara.
Yildirim said he has received reports that a general, one of those behind the coup, has been killed, and more than 130 others involved have been detained.
By the early hours of Saturday morning, lawmakers were still hiding in shelters inside the parliament building in Ankara, which had been fired on by tanks. Smoke rose up from nearby, Reuters witnesses said. An opposition MP told Reuter's parliament was hit three times and that people had been wounded.

People take cover near policemen as gunfire are heard during an attempted coup in Istanbul's Taksim Square.
A senior Turkish official told Reuters that loyalist forces were gaining control over elements trying to overthrow the government. The official also said that the faction attempting the coup has control of some tanks and has ordered its forces to try to take over streets, but have been unable to do so in many areas.
The source also said security forces are still facing some difficulties in parts of Ankara and Istanbul and that this may continue for the next 24 hours, but will be contained.
Earlier, one of the helicopters being flown by forces involved in the coup attempt was shot down over Ankara.

Turkish military blocks access to the Bosphorus bridge, which links the city's European and Asian sides, in Istanbul
Gunfire and explosions had rocked both the main city Istanbul and capital Ankara in a chaotic night after soldiers took up positions in both cities and ordered state television to read out a statement declaring they had taken power.
But by early Saturday, around 30 pro-coup soldiers were seen surrendering their weapons after being surrounded by armed police in Istanbul's central Taksim square.
They were taken away in police vans as a fighter jet repeatedly screeched overhead at low altitude, causing a boom that shook surrounding buildings and shattered windows.
A coup attempt in Turkey has precedent: Since the creation of the modern Turkish state, there have been four successful military coups.