More than 40,000 people have been detained in Turkey amidst ongoing federal investigations to uncover individuals and groups behind last month's failed coup to remove President Recep Tayyip Erdogan from office, Prime Minister Binali Yildirim said Wednesday.

About 20,355 of those detained have been formally arrested and another 79,900 have been fired from their public duty jobs, including military, police, civil service and judiciary posts. Another 4,262 companies have been shut down, including 130 media organizations.

The government is targeting those it thinks is linked to Fethullah Gulen, the U.S.-based cleric whom Erdogan has named as the individual behind the failed coup. Gulen exiled himself to the U.S. in 1999 and has denied any connection to starting the July 15 coup.

Turkey has asked the U.S. to extradite Gulen, but State Department officials said they will do so only if they find evidence of his involvement.

Turkey is a key NATO ally, partly because of its strategic location on both the Asian and European continents.