LONDON — A Turkish court sentenced 24 journalists to prison on Friday, ruling that they were linked to a religious sect that the government calls a terrorist group and that has been blamed for a failed coup attempt in 2016.

Most of the journalists worked for news organizations that are considered friendly to Fetullah Gulen, a cleric living in seclusion in a small town in Pennsylvania. The Turkish government claims that Mr. Gulen leads a shadowy, violent movement aiming to overthrow President Recep Tayyip Erdogan.

Mr. Erdogan has become increasingly authoritarian since the coup attempt. He has steadily tightened his control over the government, the military, the media, courts, schools and even the internet, fraying relations with Turkey’s Western allies. He has purged tens of thousands of people suspected of disloyalty from the government and the military, and thousands more have been arrested and charged with supporting terrorism.

In the July 2016, elements of the military appeared to seize power, and aircraft bombed the Parliament building and presidential palace in Ankara, the capital. Hundreds of people were killed and thousands were wounded before Mr. Erdogan reasserted control.