ISTANBUL — Even before he began his first day at work as Istanbul’s new mayor, Ekrem Imamoglu was being talked about as the man who could challenge President Recep Tayyip Erdogan for the leadership of Turkey in four years’ time.

For the moment he is avoiding the question, and insists that he will concentrate for the next five years on serving Istanbul, a sprawling metropolis of 15 million inhabitants, a quarter of whom live below the poverty line.

“Right now I am a person who is fully concentrated on governing,” he told foreign journalists at a news briefing on his first day in office last Friday. “But if there are those who see our star high in the sky, we thank them.”

There is no doubt that he presents a broader threat to the president. Mr. Imamoglu said he fully intended to use the enormous popular support that elected him by a surprisingly wide margin in a rerun on June 23 as a mandate to push back against Mr. Erdogan’s authoritarianism and bring democracy and fairness to all of Turkey.