ANKARA, Turkey -- Turkish Prime Minister Ahmet Davutoglu announced his resignation on Thursday, paving the way for the country's president to pursue a tighter grip on power.

Davutoglu, who had fallen out with President Recep Tayyip Erdogan, announced he was stepping aside following a meeting with executives of the ruling Justice and Development Party, or AKP, which has dominated Turkish politics since 2002.

The decision is not effective immediately. The party will hold an emergency convention May 22 to select a new party leader who would also replace the premier.

"I would never consider running as chairman if there is no consensus," Davutoglu said. "Under these conditions I am not considering standing as a candidate at the upcoming extraordinary congress."

Davutoglu indicated he did not plan to resign from the party, saying he would "continue the struggle" as a ruling party legislator. He also pledged loyalty to Erdogan, saying the president's honour was his honour, and suggested he would not be a party to any efforts to divide the party.

"I feel no reproach, anger or resentment against anyone," Davutoglu said. "No one has ever heard any word from me against our president and never will."

The shake-up is widely seen as the outcome of irreconcilable differences between Erdogan, who would like to see the country transition to a presidential system, and his once-trusted adviser. It comes a day after Davutoglu's government scored a victory of sorts, with the European Union's executive commission recommending approval of a deal to give Turkish citizens the right to travel to Europe without visas.

After being elected president in 2014, Erdogan chose Davutoglu to succeed him as premier and leader of the AKP party. Davutoglu was expected to play a backseat role as Erdogan pushed ahead with plans to make the largely ceremonial presidency into an all-powerful position.

Davutoglu stressed that he never intended to be a caretaker prime minister. He recalled that when he took over the party Erdogan said in a speech: "This is the era of a strong president and a strong prime minister."

"That was the right approach," Davutoglu said. "I took over the (prime ministry) and a worked day and night to be true to the position."

The former professor, foreign minister and adviser to Erdogan tried to act independently on a range of issues and often proved to be a more moderating force to Erdogan, who has adopted an increasingly authoritarian style of government.

Crisis talks between the former political allies dragged out for nearly two hours late Wednesday but clearly failed to resolve their differences.

Divisions between the Erdogan and Davutoglu camps first spilled into the open over the conflict with Kurdish militants in the southeast.

Erdogan took issue with Davutoglu after he spoke of the possibility of resuming peace talks with the PKK if it withdraws its armed fighters from Turkish territory. Erdogan said in a speech that it was out of the question for the peace process to restart, saying military operations would continue until the very last rebel is killed and the PKK threat is removed.

More fissures were apparent over Davutoglu's opposition to the pre-trial detention of journalists accused of spying and academics accused of voicing support for the PKK. Erdogan spurned Davutoglu and even suggested that anyone deemed to be supportive of extremists should be stripped of citizenship.

Crucially, Davutoglu gave only half-hearted support to a powerful presidential system, which Erdogan wanted to see "rapidly" introduced.

"Turkey is experiencing a systems crisis," said Turkey analyst Ozgur Unluhisarcikli of the German Marshall Fund. "According to the constitution, Turkey is a parliamentary system, but the style of governance is a de facto presidential system. As in any de facto system, this causes uncertainties and inevitable friction."

The biggest hint that Davutoglu's days were numbered came late Sunday when an anonymous Turkish blog titled "Pelican Brief" -- believed to have been authored by people close to Erdogan -- aired the presidential camp's alleged grievances with Davutoglu, including not advocating a presidential system strongly enough.

Davutoglu is widely expected to be replaced by an Erdogan ally who is unlikely to attempt an independent agenda. Political observers have cited Transport and Communications Minister Binali Yildirim, Justice Minister Bekir Bozdag and even Erdogan's son-in-law and Energy Minister Berat Albayrak as possible candidates.

Davutoglu is the latest senior AKP official to be sidelined by Erdogan as he tries to consolidate power. He joins former President Abdullah Gul and former deputy premier Bulent Arinc, both of whom had founded the party in 2001 with Erdogan.

Turkey's plunge into political uncertainty comes at a time when the country is facing serious security threats but struggling diplomatically. Turkey is a key partner of the European Union in addressing the migrant crisis and an ally of the United States in the battle against the Islamic State group.

Davutoglu's departure does not bode well for a country that still needs to meet five criteria to qualify for visa-free travel to Europe. Many Western officials preferred Davutoglu as an interlocutor to Erdogan, who has over the past few years sharpened his anti-Western rhetoric.

Erdogan has already overstepped the traditional mandate of a president by chairing Cabinet meetings.

The Cuhmuriyet newspaper characterized Davutoglu's fall from power as a "palace coup" in reference to Erdogan's extravagant presidential palace which boasts 1,150 rooms and where Erdogan's advisers are accused of running a "shadow cabinet."

The main opposition party leader, Kemal Kilicdaroglu, said a man who was elected with the will of 23 million AKP voters "was forced to leave his seat through the will of one person."

"Davutoglu bowed to the palace overthrow and paved the way for to an autocratic regime." Kilicdaroglu said. "He should have resisted and said it was the people who brought me here and it's the people who can bring me down."