While it isn’t over, the indications are the coup against Erdogan has failed. The stated goals of those behind the coup were to return to a secular government and reinstate the rule of law.
The President of the United States encouraged people to “support the democratically elected government of Turkey”. He said this while his administration is in the midst of a multi-year effort to overthrow the government of President Assad in Syria. The US, historically, doesn’t care about democracy or elections. The US wants Erdogan in power because he has more or less been an obedient lackey. While there are moments of discord, Turkey is still a faithful dog at the end of one of the many leashes held by the US. This allows Erdogan to behave in a manner that would not be tolerated from a non-puppet state.