Turkish National Intelligence Agency (MIT) spokesman said the coup attempt has been 'repelled" and Chief of Staff Hulusi Akar is now back in charge.
MIT spokesman Nuh Yılmaz said Akar the situation is back in control and everything would return to normal in few hours.
Police have detained most of the soldiers involved in attempted military coup on Friday night as hundreds of thousands people took onto streets to show solidarity with the elected government.
Soldiers involved in illegal coup attempt retreated from National Intelligence Service (MIT) headquarters after MIT forces fought against fire with fire.
Sources said that no charges will be pressed against soldiers who return to their military posts and surrender their arms.
President Recep Tayyip Erdoğan is supervising ongoing efforts and will speak within a few hours, a spokesman says. He is due to return to Istanbul in the very near future.
Erdoğan said he was still president and Turkey's commander in chief, promising that plotters would pay the heaviest price.
The news comes as broadcaster TRT - where the original coup announcement was made - returned to the air as the people and police have regained the headquarters.
Presidential Spokesman İbrahim Kalın also told NTV television: "The military commanders have made it clear that the coup plotters violated the chain of command... The people have shown that they stand in solidarity with democracy and the elected government."