“The Gulenists were threatened by the PKK because the PKK attacked their schools and dormitories while they were trying to win supporters in the southeast,” said Mustafa Akyol, a political analyst and author of a book on Turkey’s Kurds. “They feared if Erdogan made peace with the PKK, their assets in the southeast could be jeopardized.”

But analysts and officials say the language and subject of the indictment mirror longstanding Gulenist criticisms of the government. It also reflected years of jostling between the AKP, the PKK, and Gulenists — three of Turkey’s key political powers — over the loyalty of the country’s restless Kurdish minority.

Erdogan, former Prime Minister Ahmet Davutoglu, and other senior officials are named as defendants in the draft. Turkish authorities allege that followers of the religious movement led by the US-based religious scholar, Fethullah Gulen, were behind the daylong bloody insurrection, which left more than 350 people dead. Gulen, based in Pennsylvania, described by some as an Islamist cult leader, has denied the allegations .

Evidence cited in the indictment included articles and public statements. One government official described this as a signature of the Gulen movement: “That’s what they do with politically charged trials,” he said.

“While not being members of the terror organization, they helped the terror organization by letting it carry and stock heavy artillery like rocket launchers, machine guns and ammunition, not taking any measure to prevent this situation and paving the way for an armed struggle,” reads a snippet of the indictment, which was dated this year and reported on by several Turkish news outlets.

A three-and-a-half-page draft indictment obtained by BuzzFeed News and confirmed as authentic by a Turkish official suggests the coup plotters aimed to drag President Recep Tayyip Erdogan and his top officials into court on charges of colluding with terrorists for their part in a six-year attempt to negotiate a settlement with the Kurdistan Workers Party, or PKK, a militant group considered a terrorist organization by the US and the West.

ISTANBUL — The coup plotters told the world they wanted to restore democracy, liberty, and stability. But a document found at a prosecutor’s office shows that a key motivation of those who staged Turkey’s failed July 15 rebellion was their opposition to the government’s now-collapsed attempt to make peace with the Kurdish separatist rebels fighting Ankara.

Two weeks since Turkey’s failed coup, aftershocks continue to jolt the country. Officials daily announce fresh batches of detentions, firings, dishonorable discharges of soldiers and government employees, and shutting down of media outlets, charities, and schools associated with the Gulenists.

The draft indictment was discovered in the office of prosecutor Mehmet Sel, who is now among scores of judiciary officials dismissed from his job — and under arrest on charges of conspiring to attempt the coup.

For a decade, Erdogan and the Islamist-rooted Justice and Development Party (AKP) he co-founded partnered with Gulen in efforts to decrease the influence of the highly secular armed forces in Turkey’s affairs. AKP critics warned the government repeatedly about the Gulenists’ decades-old attempt to infiltrate the public sector, especially the police and the judiciary.

In February 2012, suspected Gulenists in the judiciary sought to drag Hakan Fidan, the head of Turkey’s intelligence organization, called MIT, into court on terrorism charges. The basis for the charges were his part in internationally backed negotiations with the PKK, led by its jailed leader Abdullah Ocalan. Though staunchly pro-US and in favor of expanded relations with the EU and Israel, Gulenists strongly oppose concessions to Kurds seeking autonomy and cultural rights.

“That was the beginning of the tension between the Gulenists and the AKP,” said Akyol. “Gulenists were strangely very hawkish against the PKK and they blamed the AKP, in particular Erdogan and Hakan Fidan, for talking with terrorists.”

In a rare admission of gross misjudgment, Turkey’s Interior Minister Efkan Ala acknowledged the AKP’s complicity with the rise of the Gulenists. “We didn’t heed the opposition’s warnings until the assault on MIT,” he said in a television interview with CNN Turk. “The opposition didn’t hear us out after the assault on MIT.”

Erdogan long sought the political support of Turkey’s Kurds, who account for 15% of the country’s population. But Gulen’s Islamist movement, too, has sought to make inroads among Kurds in Turkey and across the Middle East, where it has set up schools and hospitals. It has viewed the PKK, rooted in secular Marxist-Leninist ideology and Kurdish identity politics, as a rival. As Erdogan sought to work out a negotiation with Kurds, Gulenists in the security forces continued arresting and imprisoning mostly Kurdish activists in the southeast.

“The Kurds know full well that Gulen was not happy with the peace process,” said Aydin Selcen, a former Turkish diplomat who served in Baghdad and northern Iraq. “There is a clash of two different ideologies. Gulen is not only Islamist but staunchly nationalist. Their reaching out to Kurds can been as assimilation.”

The war between Turkey and the PKK continues to claim lives. At least two soldiers were killed Wednesday in a suspected PKK attack in the country’s southeast. But the coup attempt, and the various subplots revealed in its aftermath, have prompted speculation about the origins of the yearlong renewal of the conflict.

Among the arrested coup plotters were two pilots authorities say downed a Russian warplane last year, badly damaging relations between Moscow and Ankara. Some Turks have begun to question the still mysterious origins of the current round of fighting with the PKK, which broke out last summer after the murder of two police officers in the southeastern town of Ceylanpinar, an attack claimed belatedly by an offshoot of the PKK.

“That murder does not look like a PKK operation at all,” said Selcen, who now works as an independent political analyst. “They were executed with a silenced gun in their beds and the door was not forced open. Until today, the murder of the two policemen, which practically ended the peace talks, has not been clarified.”

Here is the full draft indictment (in Turkish):