ISTANBUL — Turkish investigators call it the ultimate long game.
In 1986, the Turkish military expelled dozens of cadets suspected of loyalty to a young Muslim cleric named Fethullah Gulen, seen as a potential threat to the country's strict secular rule. Officials, a magazine reported at the time, said an alleged recruiter had told the students to work their way through the ranks and wait for instructions that would come in a few decades.
Fast forward 30 years to July 15, when renegade officers staged a failed coup and President Recep Tayyip Erdogan accused Gulen of orchestrating it. Gulen, now based in Pennsylvania, denies any involvement, but a rising tide of allegations challenges the moderate image promoted by his Islamist movement and casts it as a cover for secret designs on Turkish power that included efforts to infiltrate state institutions decades ago.
In the 1970s, when Turkey was run by a military-backed, secular government, the group seemed like a conventional religious movement that attracted young, middle-class recruits through a successful network of schools and dormitories.
Gulen, who had been associated with Islamic mysticism, promoted a message of tolerance and charity along with Turkish patriotism. His group — known as Hizmet, Turkish for "service" — raised money through donations from individuals and businesses. By the early 1990s, it was expanding into other countries with a network of schools, burnishing an international reputation as an advocate of interfaith harmony.
The movement's benevolent message initially enabled its followers to dodge the harshest persecution of Turkey's secular rulers. But as it grew in influence, the government began to view the movement with suspicion.
Authorities alleged its supervisors — known as "brothers" — helped followers cheat on exams to land government jobs. Once they were in place, according to Hanefi Avci, a former national police chief who investigated the group, they "acted in a coordinated effort to promote and protect one another and eliminate opponents."
The group enjoyed wide influence in schools, the news media and police forces in an expanding power base, and authorities began to crack down on pieces of the movement such as the 1986 purge of military cadets.
Authorities point to Gulen's own words as evidence of his designs. In comments recorded in the 1980s, Gulen referred to crackdowns on Islamists in Syria and Egypt and told a group of followers to bide their time, saying: "You must move within the arteries of the system, without anyone noticing your existence, until you reach all the power centers."
Gulen, who later said those remarks were misinterpreted, moved to the United States in the late 1990s while facing trial on charges of plotting to overthrow Turkey's government. His movement continued to grow, and eventually helped to topple the staunchly secular leaders who had been so wary of it.
In 2002 elections, Gulen's followers supported the candidacy of the former Istanbul mayor, who himself had been jailed for several months by secular authorities and won with the backing of a pious Muslim class that had been sidelined to decades.
His name was Erdogan.
Erdogan insists he put up with the Gulenists as a practical matter: He needed all the help he could get to defeat the secularists.
"We tolerated them for the sake of the widespread aid, education and solidarity activities — inside and outside of the country — that they seemed to be conducting," he said this month. "We tolerated them because they said 'Allah.'"
The military leadership remained unconvinced. Ilker Basbug, who was Turkey's military chief from 2008 to 2010, said in a recent interview with CNN Turk television that he warned Erdogan about the threat from Gulen's backers in the military, which had stopped purging suspected Islamists.
"Today this threat is to us, tomorrow it's to you," he says he told Erdogan.
According to Basbug, Erdogan responded: "My commander, you are exaggerating."
After he retired, Basbug was jailed on charges of plotting to overthrow the state, one of hundreds of people associated with the old secular order who were targeted by alleged Gulen sympathizers in the police and judiciary. Avci, the former national police chief who had written a book about the alleged threat from Gulen's supporters, was also imprisoned.
Erdogan initially supported some of the investigations, but he eventually disowned them amid revelations of forged evidence and other irregularities.
Meanwhile, the Turkish leader's alliance with Gulen was unraveling as he sought to dismantle what he described as a "parallel state" in the police and other institutions. In what Erdogan later described as an attempted coup, prosecutors believed to be loyal to Gulen launched a high-profile corruption probe in December 2013, embarrassing the government.
Tensions rose further in 2014, when Erdogan switched from prime minister to president in a move seen by critics as a bid to amass even more power.
Finally, on July 15, elements of the military rose up. They occupied airports, bridges and military bases, took the military chief hostage and accused the government of eroding democracy and the rule of law. Rival forces clashed, and Erdogan supporters took to the streets in support of their president. Some protesters were cut down by gunfire from mutinous soldiers, but by morning it was clear that the coup had failed. In all, 272 people were dead.
Erdogan was quick to point the finger: He said the coup was the work of Gulenists. Gulen condemned the coup, although he conceded that some of his sympathizers might have been involved.
"You can think about many motivations of people who staged this coup. They could be sympathizers of the opposition party. They could be sympathizers of the nationalist party. It could be anything," Gulen told reporters at his Pennsylvania compound the day after the coup.
Yet he still had harsh words for Erdogan, whom he called an authoritarian figure, and his government. He said it has shown "no tolerance for any movement, any group, any organization that is not under their total control."
Torchia reported from Johannesburg. He was The Associated Press' bureau chief in Turkey from 2007-13, and covered the aftermath of the attempted coup last month.
Follow Christopher Torchia on Twitter at www.twitter.com/torchiachris