The AKP won most votes nationwide in last Sunday's election, but results showed the ruling party lost Ankara and was also narrowly defeated in Istanbul in what would be one of their worst setbacks in a decade and a half in power.
Electoral authorities are conducting a recount in scores of districts in Ankara and in Istanbul where tallies showed the opposition CHP candidate Ekrem Imamoglu with a very slim lead over the AKP.
"At the end of the day, we will accept the final result regardless of whether it is to our advantage or disadvantage," AKP spokesman Omer Celik told a briefing for the foreign press in Istanbul.
Voters may have punished the AKP at the ballot box, with Turkey's economy in recession after a currency crisis last year that hit Turkish households hard when the lira lost 30 percent of its value.
Losing Istanbul would be a blow to Erdogan, who built his political career as mayor of the city before becoming prime minister and later president.
In Istanbul, CHP candidate Imamoglu and the AKP's Binali Yildirim both declared victory when preliminary results showed them in a dead heat.
The AKP later appealed saying it had found irregularities in tens of thousands of votes.
Imamoglu's party said on Saturday he was still ahead by close to 18,000 votes with half of the recount completed. He has said he expects the recount to be finished by the end of the weekend, but the AKP could still appeal again to the Supreme Electoral Council.
Celik said the AKP would still control districts and municipal councils in both of the key cities even if they lost the mayor's offices. But he said the party would not deliberately block opposition mayor's agendas.
Erdogan, in power for 16 years, fought hard before the vote, holding rallies across Turkey where he described the election of mayors and district councils as a battle for the nation's survival.