ANKARA, Turkey — Turkey’s president, Recep Tayyip Erdogan, declared a three-month state of emergency on Wednesday that gave the state extra powers to pass laws as the authorities pursue individuals suspected of attempting to topple his government.

The declaration followed the firing and suspension of tens thousands of soldiers, educators and civil servants in recent days on suspicion of complicity in the failed coup last week.

In a televised address on Wednesday evening, Mr. Erdogan said the extra powers were needed to protect Turkey’s democracy, and he criticized Western nations who have accused his government of overreaching in its efforts to root out opponents.

“The aim is to rapidly and effectively take all steps needed to eliminate the threat against democracy, the rule of law and the people’s rights and freedoms,” Mr. Erdogan said.