The two men came from different backgrounds, but shared a belief in Allah and a common goal : power. Recep Tayyip Erdogan and Abdullah Gül, now respectively prime minister and president of Turkey, have worked together since the 1990s and their alliance has helped political Islam attain more power than ever before.
The current protests in Turkey, though, are threatening to break that alliance apart. Elements of Turkish society have risen up against their government and called on Prime Minister Erdogan to resign. Yet even as protesters and police clash in the streets, another power struggle is taking place in Ankara. President Gül is increasingly seeking to distance himself from his former political ally.
Erdogan and Gül are different in both background and character. Erdogan worked hard to get where he is today. As a child, he sold sesame rings in Istanbul's port neighborhood of Kasmpasa. He was also an avid soccer player, earning himself the nickname "Imam Beckenbauer." Although he managed to attend university and later became Istanbul's mayor, Erdogan was never able to conceal his simpler origins -- nor did he want to. He is moody, temperamental and unrestrained , qualities that may well be his undoing in the current crisis.
Gül, on the other hand, comes across as being diplomatic and moderate. Unlike Erdogan, he speaks English. Gül's parents were relatively well-to-do, sending their son to study economics in Istanbul and London. Gül worked as a manager for an Islamic bank in Saudi Arabia before being elected to Turkish parliament in the 1990s as part of the Islamist Refah movement.
At the time, the country was run by the military, a legacy from the days of Mustafa Kemal, known as Atatürk, founder of the Republic of Turkey. The country was secular, militaristic and authoritarian. At the time, Gül promised: "The secular system has failed. We want to change it definitively."
Erdogan, too, was involved in the Refah movement. He and Gül had little in common on a personal level, but were aware they would only succeed in their power struggle against the secular establishment if they worked together.
Showdown with the Military
First, they seized control within their own camp by pushing out aged Refah leader Necmettin Erbakan, who was briefly Turkey's prime minister from 1996 to 1997, before the military, disapproving of his Islamist bent, forced him out of office and banned his party. Erdogan and Gül were among the founders of its moderate Islamic successor party, the AKP (Justice and Development Party), which achieved a surprise victory in the following year's parliamentary elections.
At the time, Erdogan was banned from holding political office after giving an inflammatory speech and it was Gül who took charge of forming the new government. When Erdogan took over as prime minister in 2003, Gül became foreign minister. Four years later, despite massive resistance from the opposition, Gül became president.
The Gül-Erdogan alliance has weathered many crises, defying an attempt to ban the party, led by the judiciary in Ankara, and defeating the military. They have modernized the country's economy but also marginalized the opposition, sometimes using unseemly methods.
Mud-Slinging behind the Scenes
More recently, though, the two have had trouble concealing the discord between them. According to a US State Department diplomatic cable made public by WikiLeaks in 2010, Gül seizes every opportunity to make Erdogan look bad. Gül, the cable notes, frequently badmouths Erdogan, even in front of guests of state and especially when the prime minister is traveling abroad. Gül, the American diplomats concluded at the time, was trying to gain more power over the party by undermining Erdogan.
Never, it seems, has there been a better opportunity than now. Erdogan, although he would never admit it, has been tarnished by the Gezi Park uprising. The stubbornness with which he has reacted to the protests has alienated even some of his supporters.
Gül is now testing how far he can go with his criticism of Erdogan. He hasn't openly positioned himself against the prime minister, at least not yet. But he has made statements in support of the people's right to demonstrate. Democracy isn't limited to election day, he has said, declaring that the protesters' message had been heard.
These words may seem to lack courage in the face of the brutality with which police have for weeks been responding to the demonstrations. But for Turkey, where Erdogan has reigned unchallenged for 10 years, they represent a minor revolution.
Struggles over Influence and Government Posts
The conflict between the two AKP leaders has to do more with influence and government posts than with ideology. Both men are deeply involved in conservative Sunni Islam.
Erdogan, though, has close ties to the conservative Naksibendi order, whereas Gül is an adherent of the movement following Islamic preacher Fethullah Gülen. Followers of this elderly imam have established a global network of schools, banks, insurance funds and media outlets. They present themselves outwardly as modern, but pursue an uncompromisingly Islamist agenda.
And increasingly, they are calling the shots within the Turkish government. Daily newspaper Zaman, which has ties to the Gülen movement, has published increasingly open criticism of the prime minister in recent months. Erdogan has fought back determinedly, allowing no doubt to be cast on his unlimited rule.
What can the embattled prime minster do? Erdogan will surely have to give up his previous plan, which was to become president himself. At the moment, government insiders in Ankara consider it most likely that Erdogan will try to change the law that governs political parties and continue his reign as prime minister. Gül would be compensated with a further term as president.
The question is whether Gül will go along with this solution and whether the Gülen faction that backs him will accept it. If not, the movement's only choice will be to leave the AKP, which would divide the country's conservative camp and spell the beginning of the end for political Islam in Turkey.