ANKARA/ISTANBUL (Reuters) - Turkey has dismissed nearly 1,700 military personnel and closed more than 130 media outlets, official sources said on Wednesday, amid a deepening crackdown that has stirred alarm among Ankara's NATO allies following this month's failed coup.

A total of 1,684 military personnel have been dishonorably discharged, a Turkish government official said, citing their role in the July 15-16 abortive putsch, where a faction of the military attempted to topple the government.

President Tayyip Erdogan has accused U.S.-based Muslim cleric Fethullah Gulen of masterminding the failed coup and authorities have already suspended, dismissed or placed under investigation more than 60,000 soldiers, police, teachers, judges and others suspected of links to the Gulen movement.

Gulen denies any involvement in the coup attempt.

Of the military personnel whose discharge was announced on Wednesday, 149 were generals and admirals, the government official said. That would represent roughly 40 percent of all Turkish generals and admirals, military data show.

In addition, the government said in its official gazette that three news agencies, 16 television channels, 45 newspapers, 15 magazines and 29 publishers have been ordered shut down.

These moves, which follow the closure of other media outlets with suspected Gulenist ties, will further stoke concerns among rights groups and Western governments about the scale of Erdogan's post-coup purges.

The United States said on Wednesday it understood Turkey's need to hold perpetrators of the attempted coup to account but said the detention of more journalists was part of a "worrisome trend".

Earlier on Wednesday, Turkey ordered another 47 journalists detained as part of the crackdown on Gulen's supporters.

However, the names include known leftists who do not share the Gulenists' religious outlook, increasing concerns that the crackdown may be indiscriminately sweeping up people simply because they are critical of Erdogan and his government.

(Reporting by Tulay Karadeniz, Gulsen Solaker in Ankara and Humeyra Pamuk and Can Sezer in Istanbul; Writing by David Dolan; Editing by Gareth Jones)