By Orhan Coskun and Gulsen Solaker
ANKARA (Reuters) - Turkish President Tayyip Erdogan has built a career on attacking the elite, secularist tradition reviled by many of his pious supporters. In the heat of political battle, he has even accused secular opponents of allying with terrorists.
But now, the Islamist-rooted AKP party Erdogan created is moving tentatively towards a once-unthinkable coalition with the opposition Republican People's Party (CHP), founded in the 1920s by the 'father' of modern Turkey Mustafa Kemal Ataturk as guardian of that secularist state order.
An AKP-CHP coalition, after the AKP lost its majority in June 7 polls, would likely be fragile and factious. But it would, analysts say, help placate jittery foreign investors and revive attempts to settle a Kurdish rebellion in the southeast that has cost Turkey dearly.
NATO allies, keen to see a stable Turkey on the borders of Syria and Iraq, would also welcome a coalition offering at least some prospect of stability.
It could also curb some more radical tendencies of Erdogan, who has struck an increasingly bellicose tone towards critics and demonstrators and "those who sip their whiskies on the banks of the Bosphorus".
For Erdogan, though, an alliance with CHP could be presented as further evidence of the AKP's ability to transform modern Turkey - by toppling the secularists and now, more than a decade later, extending them an olive branch, said Halil Karaveli, managing editor of the journal The Turkey Analyst.
"The AKP do not want to look like a right-wing party. They want to be seen as the party that is reforming Turkey," Karaveli said.
Reform Turkey it has. The secularist army has been pressed from politics and social and economic reforms introduced. Erdogan, who himself served a jail sentence in the 1990s for reciting a poem rich in religious imagery, has presented himself as guardian of conservative muslims downtrodden by past secular rulers.
The CHP itself has also looked to change over 13 years of AK Party rule, reining in some secularist rhetoric, in an effort to win back conservative Turks who have flocked to Erdogan.
In coalition, however, the CHP would refuse to back his plans for the powerful presidency he envisaged when he stepped down as prime minister last year. It would also steer a cautious course on Syria as Erdogan considers armed invention at the border.
AKP Party officials have privately said Erdogan may see a snap election as the best way for the AKP to restore its majority and push constitutional changes to give him his executive presidency.
However, that option looks unlikely after a poll last week showed voters would be unwilling to change their vote. While a coalition with the right-wing Nationalist Movement Party (MHP) would make sense ideologically, AKP officials say their top brass is leaning toward an alliance with the center CHP.
"The AKP voter base wants the MHP as a coalition partner, but the top, the administration, prefers the CHP," said one AKP official. "Our party leaders believe a coalition with the CHP is more reasonable way to solve Turkey's problems."
A coalition with the CHP could help restart talks to end the Kurdish peace process, talks the nationalists have long opposed.
The fate of Turkey's 14 million Kurds is one of the country's most vexing political questions. Erdogan took a big gamble in 2012 when he opened talks to end a three-decade insurrection for greater Kurdish autonomy that has left 40,000 dead.
While talks have stalled and Kurds accuse Erdogan of backtracking, he undoubtedly sees the peace process as a key legacy.
Erdogan has warned, however, that Turkey would not tolerate the creation of an autonomous Kurdish state on its southern borders and newspapers have carried reports he is considering the creation of a buffer zone across the border, where Kurdish militia and Islamist militants vie for control.
CHP leader Kemal Kilicdaroglu warned on Tuesday against military action, employing language hardly conducive to successful coalition talks. War is not a child's game, he said.
"A good politician knows that feeding off chaos and war will bring disaster instead of success," he said on Twitter, in comments clearly aimed at Erdogan."
"This country is not a plaything for your ambition."
Financial markets are hoping for a grand coalition, with the lira currency last week recovering to pre-election levels against the dollar for the first time.
Investors have been betting that the AKP's decision to nominate its low-profile defense minister for parliamentary speaker may be a sign it could be willing to cede the post to the opposition in return for a coalition deal.
The party on Friday named Ismet Yilmaz as its candidate for speaker, tapping a veteran backbencher without the name recognition of the CHP's candidate, Deniz Baykal, a former head of the party and parliament's oldest deputy.
Voting for the position started on Tuesday and was due to go into third and fourth rounds on Wednesday after no one candidate was able to secure two-thirds of the votes.
There is speculation the AKP may back Baykal on Wednesday. If so, that would be an important signal for a potential coalition with the CHP, a senior CHP official said.
But Prime Minister Ahmet Davutoglu appeared to throw cold water on that theory, saying on Tuesday that the AKP would back its candidate through all rounds of voting.
(Additional reporting by Ece Toksabay; Writing by David Dolan; editing by Ralph Boulton)