SILIVRI, Turkey — Turkish courts are just weeks from concluding some 300 mass trials intended to draw a line under the most traumatic event of Turkey’s recent history: the failed 2016 coup that killed 251 people, mostly civilians, and wounded more than 2,000.

So far, nearly 3,000 security personnel and civilians have been convicted, and the sweeping verdicts have been welcomed by the government and its supporters as justice served.

But the process has also widened political divisions in Turkey and deepened a sense of persecution among government opponents, who say the mass trials are emblematic of an increasingly arbitrary system of justice under President Recep Tayyip Erdogan.

More than two years after the coup attempt, Mr. Erdogan’s government continues to press its pursuit and prosecution of those suspected of being in league with the man it accuses of organizing the plot, the Muslim cleric Fethullah Gulen.