Turkish President Recep Tayyip Erdogan on Sunday gave his close ally and Transport Minister Binali Yildirim the mandate to form a government as prime minister in a move set to further consolidate the strongman's grip on power.
Yildirim had earlier been chosen by the ruling party as its new chairman, immediately vowing to make a priority out of implementing Erdogan's controversial plan for a presidential system to enshrine his status as the Turkish number one.
He replaces in both posts Ahmet Davutoglu, a former foreign minister who promoted his own ambitious agenda but threw in the towel after a power struggle with Erdogan.
Yildirim, 60, was the only candidate at the ruling Justice and Development Party (AKP) extraordinary congress in Ankara, receiving 1,405 votes from 1,470 delegates present.
In a carefully choreographed process, Davutoglu hours later met Erdogan at the presidential palace to formally submit his resignation as prime minister.
Yildirim then also went to the palace to be given the mandate to form the new government as premier, a presidential statement said.
Davutoglu will stay on as premier until a new government is formed but that should be in the next days.
By AKP convention, the posts of premier and ruling party chief are held by the same person.
Analysts expect Yildirim to be a more pliant figure for Erdogan and he lost no time in making clear his enthusiasm for the presidential system plan.
"Turkey needs a new constitution. Are you ready to bring in a presidential system?" Yildirim said to cheers at the congress, saying this was the way to end the current "confusion".
Erdogan first came to power as prime minister in 2003, switching to the presidency in 2014. If he seeks a second presidential mandate in 2019, he could stay in power until 2024.
In a second speech after his election was confirmed, Yildirim added: "Our path is the path of Recep Tayyip Erdogan."
Transport minister for almost all of the last decade and a half, Yildirim has been Erdogan's pointman for the implementation of his grandiose road and rail infrastructure projects.
He is only the third party chairman in the history of the AKP -- which has transformed Turkey by putting Islam at the forefront of the officially secular country's politics -- after Erdogan and Davutoglu.
Not known for charisma, Yildirim made a glitzy entrance in front of thousands at the congress, clad in football scarves and throwing carnations into the crowds to the sound of thumping Turkish pop music.
However his speech was marred by a hoarse voice as he seemed unaccustomed to the challenge of addressing such a vast audience.
Erdogan was not at the congress, with existing rules stipulating the head of state should not be a member of a party, something the president may want to change in a new constitution.
But Justice Minister Bekir Bozdag made no secret of who he thought was the guiding light of the AKP, saying: "The AK Party is Tayyip's party."
In a message from Erdogan read by Bozdag, the president said "the bonds of my heart with you have never and will never be cut."
Despite rumours he is privately deeply embittered over his exit, Davutoglu put on a show of loyalty to the party, saying: "The AK Party's unity is more important than anything for me."
Divisions between Davutoglu and Erdogan had been boiling for months over a series of issues including the presidential system and an ambitious deal with the EU on stemming the migrant influx to Europe.
Erdogan's critics have accused him of authoritarianism, with the latest controversy surrounding a bill adopted by parliament on Friday that would lift immunity for dozens of pro-Kurdish and other MPs and could see them evicted from parliament.
Heading on a visit to Turkey, German Chancellor Angela Merkel voiced "great concern" over recent political developments in the country.
Yildirim also warned the European Union to be honest about Turkey's long-stalled membership bid, as frustration grows in Ankara that the EU will not fulfil its side of the migrant deal.
"There is one thing that needs to be done by the European Union. This confusion over Turkey's full membership and the migrant issue has to be brought to an end," Yildirim said.
Both Erdogan and Yildirim are strongly opposed to resuming talks with the outlawed Kurdistan Workers' Party (PKK), the Kurdish militant group that has killed hundreds of members of the security forces since a two-year-long ceasefire collapsed in 2015.
"Operations will continue uninterrupted until the PKK terrorist organisation -- whose hands are in blood -- ends its armed actions," Yildirim said.