ISTANBUL — Turkey’s President Recep Tayyip Erdogan said Saturday that government forces have crushed a coup attempt and that the plotters will “pay a heavy price for their treason.”

After a night of turmoil in the streets of major cities, Turkey’s state-run Anadolu Agency said all soldiers involved in the attempted coup at the military headquarters in the capital, Ankara, had been taken into custody.The report saids anti-terrorism police will now conduct a “detailed search” at the headquarters.

In an unprecedented show of unity, all four parties represented in parliament met to issue a joint declaration Saturday condemning the attempted coup against Erdogan’s government.

The extraordinary session began with a minute of silence in honor of those who lost their lives during the coup, followed by the singing of the national anthem.

Erdogan vowed retribution after a chaotic night of clashes between loyalists and rebels that left almost 200 people dead and may not be entirely over. “In Turkey the army is not governing the state and they cannot, and this should be known by all,” Erdogan said, addressing crowds in Istanbul on Saturday morning. “The government is in control.”

He said the coup’s supporters — rogue elements in the military — would “pay a heavy price for their treason to Turkey” and that “those who stain the military’s reputation must leave. The process has started today, and it will continue just as we fight other terrorist groups.”

While Erdogan insisted the government was in control, some fighting appeared to continue into Saturday. Gen. Umit Dundar, a newly appointed acting military chief, told the Associated Press that at least 194 people died in clashes; 41 police officers, two soldiers, 47 civilians and 104 people described as “coup plotters.”

Turkey’s state-run Anadolu news agency said 2,000 military personnel were detained across Turkey as the government cracked down on the coup.

In Istanbul, images on television and social media on Saturday morning showed soldiers with their hands up walking away from tanks on the city’s Bosphorus Bridge.

The coup attempt began late Friday with a statement from the military saying it had seized control “to reinstall the constitutional order, democracy, human rights and freedoms, to ensure that the rule of law once again reigns in the country, for law and order to be reinstated.”

Political turmoil has engulfed Turkey for months. There has been a crackdown on dissidents and opposition media and renewed conflict in the mainly Kurdish areas of the southeast. Critics blame Erdogan’s increasingly authoritarian rule for eroding democracy and secular laws.

Meanwhile, Turkey, a NATO member and a key partner in U.S.-led efforts to defeat the Islamic State group, has seen a wave of terrorist attacks that have crippled one if its biggest industries: tourism.

The Turkish government has also indicated that it thinks a Muslim cleric living in exile in Pennsylvania may be partly behind the coup. Fethullah Gulen promotes a philosophy that blends a mystical form of Islam with staunch advocacy of democracy, education and science.

Y. Alp Aslandogan of the New York-based Alliance for Shared Values, a group that promotes Gulen’s ideas, denied the claims.

Erdogan was vacationing in southwest Turkey when the coup began. He issued a defiant address to the nation in a FaceTime call from his mobile phone.

He called on his followers to rally in the city squares and to flood the streets to confront the coup plotters. “I’ve never seen anything more powerful than the people,” he said.

In Washington, President Obama urged all parties in Turkey to support Erdogan’s government. German Foreign Minister Frank-Walter Steinmeier said in a statement Saturday that democracy needed to be defended and condemned “any attempts to change the democratic order in Turkey by force.”

Hjelmgaard reported from Berlin.

Gannett