ISTANBUL — Turkey’s government, rallying behind its defiant leader, rounded up thousands of military personnel on Saturday who were said to have taken part in an attempted coup, moving swiftly to re-establish control after a night of chaos and intrigue that left hundreds dead.

By midday, there were few signs that those who had taken part in the coup attempt were still able to challenge the government, and many officials declared the uprising a failure.

President Recep Tayyip Erdogan, speaking to hundreds of flag-waving supporters outside his home in Istanbul on Saturday evening, declared that “the strong aren’t always right, but the right are always strong.” He called on the United States to arrest an exile living in Pennsylvania who Mr. Erdogan claimed was behind the coup attempt.