ISTANBUL — The Turkish prime minister, Ahmet Davutoglu, a close ally of President Recep Tayyip Erdogan, will soon leave office, a government official said. His departure is occurring amid a disagreement between the two men over Mr. Erdogan’s drive for more power.

The two leaders met on Wednesday night, according to the Turkish official, who spoke on condition of anonymity to discuss a decision that had not been announced publicly. “It’s unlikely that Davutoglu will run for leadership again,” he said.

The prime minister is expected to hold a news conference on Thursday after a meeting with officials of the governing Justice and Development Party, or A.K.P., according to Turkish news reports, which also said that Mr. Davutoglu was likely to step aside after a coming special party congress.

The leadership change atop the Islamist party comes as the country is facing multiple challenges, including a war with Kurdish militants, terrorist attacks by Islamic State fighters, and the arrival of millions of Syrian refugees. The shuffle clears the way for Mr. Erdogan, who critics say has become increasingly authoritarian, to consolidate even more authority.