Ekrem Imamoglu delivered a stinging setback to Erdogan's ruling party

Istanbul (AFP) - Istanbul's new mayor on Sunday called for a rally to celebrate a "new beginning" urging people to unite after he won a highly contested race against President Recep Tayyip Erdogan's ruling party.

Ekrem Imamoglu, 49, of the opposition Republican People's Party (CHP), narrowly edged out his rival to capture Istanbul mayor's office in a stinging setback to Erdogan's ruling AKP after a decade and a half in power.

The Justice and Development Party (AKP) is still seeking a rerun of the March 31 Istanbul ballot, but electoral authorities on Wednesday handed Imamoglu his mandate after he won a slim 13,000-vote lead over AKP's Binali Yildirim.

Imamoglu supporters were expected to pack the vast Maltepe shoreside area on the Asian side of Istanbul for the rally.

Imamoglu, a soft-spoken former district mayor who struck a conciliatory tone throughout the heated race, has vowed to serve all citizens of the 16-million strong city, regardless of their political inclinations.

"We are united now. The whole of Istanbul is meeting in Maltepe for a 'new beginning'," the new mayor announced on his official Twitter account on Saturday.

Imamoglu, who will govern the city for the next five years, said the Maltepe rally was not a political gathering, but a way to introduce the city's new administration to the people of Istanbul.

"I want you to know that a new beginning is very valuable," he said. "The coming five years is not only five years for the mayor but also for 16 million people."

- Legal battle -

The loss of Istanbul was a major blow to Turkey's combative leader Erdogan who once said winning the city was like winning Turkey -- as his party and its political predecessors ruled the city for the past 25 years.

A former mayor of Istanbul himself, Erdogan has often boasted of the ambitious projects under his rule including a new international airport and a third bridge in Istanbul -- the country's economic hub.

Erdogan's party has applied to the country's Higher Election Board (YSK) for an "extraordinary" appeal to redo the election in Istanbul in the last attempt to overturn the result.

Imamoglu secured a narrow win following a recount of votes for two weeks. His lead narrowed from around 20,000 after a recount of invalid ballots in several Istanbul districts.

The AKP on Saturday presented a new petition to the YSK to cancel the Istanbul vote on the grounds that some ballot box observers were former civil servants dismissed from their public service jobs under the presidential decree, the state-run Anadolu news agency reported.

Erdogan met with AKP's municipal council members as well as district heads at his party's Istanbul headquarters. The meeting was closed to the press.

On the election trail, Imamoglu ran a low-key campaign going door to door, whereas Erdogan and his right-wing nationalist ally MHP party often held large rallies in what the president said was a battle for survival.