Turkish Prime Minister Ahmet Davutoglu said Thursday he will step down as head of the ruling Justice and Development Party (AKP), clearing the way for him to be replaced as head of government.
His move comes after growing public disagreement with President Recep Tayyip Erdogan, whose rule critics call increasingly authoritarian.
Following a meeting of the AKP's Executive Board in Ankara, Davutoglu said he had decided not to seek a new mandate when an extraordinary convention is held on May 22 to choose the new leader of the AKP, which has held power in Turkey since 2002.
By stepping aside, Davutoglu effectively allows Erdogan to choose a new party boss who would in turn be named prime minister - in the same way Davutoglu came to be premier in August 2014.
Davutoglu said at a press conference that his "mind is at peace" over his two-year tenure and touted his party's accomplishments while he was in the job.
"Our party is about to enter a new era," he proclaimed, saying his decision "was not taken out of a feeling of failure or remorse."
In an apparent attempt to try to dispel talk of a power struggle, Davutoglu stressed his loyalty to Erdogan: "His family's honour is my family's honour. His family is my family."
The political drama has the potential to further unsettle Turkey at a time it is struggling to cope with millions of refugees from Syria and government forces escalate their fight with Kurdish separatists in the south-east.
Recent terrorist attacks across the country, including in Istanbul and Ankara, have killed dozens.
Investors were rattled Thursday by the uncertainty, with the yield on 10-year government bonds rising 37 basis points to 10 per cent - the highest one-day increase since June 2015.
On the stock market, the leading ISE National 100 index was experiencing its fifth straight day of declines.
Following Turkey's first direct presidential election in 2014, a newly elected President Erdogan hand-picked Davutoglu, who was then foreign minister, to become the AKP's leader and prime minister.
But disagreements between the low-key Davutoglu, known for his pragmatic approach, and the more confrontational Erdogan have emerged recently on issues ranging from closer relations with the European Union to the prime minister's suggestion of holding fresh peace talks with Kurdish militants.
Just days ago, Davutoglu's power to appoint party leaders at the provincial and district level was taken away from him.
In one his most prominent roles on the international stage, Davutoglu and German Chancellor Angela Merkel were the chief architects of the EU-Turkey migrant deal forged in March.
His exit could prove a major test of the agreement, in which Ankara received a package of incentives from the EU - including aid money and progress on a visa-free travel scheme - in exchange for taking back migrants who had crossed by sea from Turkey to Greece.
Analysts say Davutoglu's outspokenness and newfound stature may have aggravated Erdogan, who was prime minister for more than a decade before becoming president and has sought to extend his authority since.
Turkey's main opposition leader Kemal Kilicdaroglu told dpa that Davutoglu's resignation is an "affirmation of dictatorship in Turkey."
"Erdogan wants a prime minister who obeys him 100 per cent," said Kilicdaroglu, who heads the centre-left party CHP.
One of Erdogan's chief aims is the transition of the country from a parliamentary to presidential system - a move that would further strengthen his grip on power.
To achieve this goal Erdogan is pushing for a new constitution to replace the current document, which was drafted after the 1980 military coup.
He argues that rewriting the document will help the country function more smoothly. Critics say it will erode Turkey's democracy while giving Erdogan more control.
But to put a new constitution to a popular referendum, the AKP would need at least 330 votes in parliament. The Islam-rooted party, founded by Erdogan, currently commands 316 seats in the 550-member house.
Born in 1959, Davutoglu received a doctorate in international relations from Turkey's Bogazici University and worked for years as a professor before becoming foreign minister in 2009.
Transport Minister Binali Yildirim and Energy Minister Berat Albayrak, who is Erdogan's son-in-law, are among those being considered as possible successors to Davutoglu, according to the Cumhuriyet daily.