For the third time in less than four years, Ahmet is changing his vote.

Years ago, the 39-year-old Kurdish cook, who works at an Istanbul restaurant, used to vote for the Justice and Development Party, or AKP, of Turkey’s president Recep Tayyip Erdogan, who appealed to Kurdish voters by relaxing restrictions on their language and cultural practices.

Then, in 2015, he began voting for the Kurdish-led Democratic People’s Party, or HDP, led by Selahattin Demirtas, the now-imprisoned Kurdish politician.

But in a realignment that could have a major impact on Turkey’s domestic politics and play a key role in the closely followed Istanbul mayoral election on 23 June, Ahmet, along with other members of the Kurdish community, is planning on voting for Ekrem Imamoglu, the rising star of the secular People’s Republican Party, or CHP.

“I used to vote for the AKP in the early years, because they had given promises to try to solve the Kurdish problem,” he said during a conversation about politics in a café in the largely Kurdish Tarlabasi neighbourhood of Istanbul. He asked his last name not be published.

“Now they have moved against us.”

Election in Turkey: the reaction in pictures Show all 10 1 /10 Election in Turkey: the reaction in pictures Election in Turkey: the reaction in pictures Supporters of Mr Erdogan celebrate in Istanbul Getty Election in Turkey: the reaction in pictures A supporter of Mr Erdogan carries his portrait in front of a Turkish flag Reuters Election in Turkey: the reaction in pictures Following the election, a shipowner reads a newspaper that covers the result AP Election in Turkey: the reaction in pictures Supporters of Muharrem Ince, defeated opposition candidate, wait outside the Republican People's Party (CHP) headquarters following Mr Erdogan's claim of victory Getty Election in Turkey: the reaction in pictures People in an Instanbul barber shop listen to Muharrem Ince's speech following the results EPA Election in Turkey: the reaction in pictures Supporters of the pro-Kurdish People's Democratic Party (HDP) hold photos of its leader Selahatin Demirtas AFP/Getty Election in Turkey: the reaction in pictures Supporters of Mr Erdogan celebrate outside the AK party HQ in Ankara Getty Election in Turkey: the reaction in pictures Mr Erdogan waves to supporters in Ankara AP Election in Turkey: the reaction in pictures Mr Erdogan waves to supporters in Ankara AP Election in Turkey: the reaction in pictures Supporters of Mr Erdogan light flares as they celebrate the result AP

Mr Imamoglu narrowly won mayoralty, snatching Istanbul from the AKP after 25 years with 14,000 more votes in a 31 March election that was voided by an election panel packed with Erdogan supporters.

But the AKP faces major challenges in the mayoral re-election it demanded and received. Polls suggest Mr Imamoglu is ahead of the AKP’s candidate, Binali Ylidrim, by between 2 and 4 per cent.

Mr Yildirim is a competent but low-energy former minister trying to campaign as an underdog even as his party has controlled the city for a quarter of a century.

A significant number of AKP voters resent the restaging of the 31 March election, and sympathise with Mr Imamoglu.

With the Turkish economy in the doldrums, party rank and file face an enthusiasm gap compared with boisterous supporters of Mr Imamoglu, whose slogan, “everything will be beautiful”, has dominated the election season.

“We are all drowning in this slogan,” AKP lawmaker Ismet Ucma complained to party members in a meeting this month.

“But do you know why you cannot find a slogan? Because to find a slogan a person or a cause or should be excited.”

But pollsters and political analysts say the AKP’s biggest obstacle to victory may be the estimated 20 per cent of Istanbul voters who are of Kurdish descent.

They constitute a swing vote of sorts. The ones who once voted for the AKP are increasingly abandoning the party, staying home or even voting for the candidate of the CHP, which has long been considered a haven for anti-Kurdish sentiment.

On Tuesday, the charismatic Mr Demirtas, now being held in prison on security charges, issued a Tweet urging Kurds and supporters of his HDP to vote for Mr Imamoglu.

“For now, we believe that Mr Imamoglu’s discourse should be supported,” he wrote. “Because we’re beautiful together.”

According to polling and market research data cited by scholars and local media, some 150,000 HDP supporters who voted in 2018 presidential elections stayed home on 31 March and are now considered likely Imamoglu supporters.

On Tuesday, in an appearance on state television, Mr Imamoglu sought to solidify his support among Istanbul Kurds, dismissing allegations by pro-government supporters that the HDP and Mr Demirtas are terrorists.

“He talks about friendship, peace, love,” Mr Imamoglu said. “The support he gave me is also very nice.”

The AKP, with Islamist roots, has sought to reconnect to conservative Kurds who for years preferred it to the leftist HDP, which has ties to the outlawed Kurdistan Workers Party, or PKK that Turkey, the US and EU regard as a terrorist organisation.

He has organised meetings with Mr Yildirim and Kurdish leaders in Istanbul.

‘No one should ‘otherise’ or separate the Kurds’ Binali Yildrim, AKP mayoral candidate

Mr Yildirim was also dispatched to the country’s heavily Kurdish southeast, where he even used the word “Kurdistan” in a speech, prompting anger among hardcore Turkish nationalists.

“The people living on each and every inch of this country are our first-class citizens,” Mr Yildirim said in a 9 June speech in eastern Turkey. “No one should ‘otherise’ or separate the Kurds.”

But many experts doubt Mr Yildirim will be able to overcome the Kurdish support for Mr Imamoglu.

“The HDP voters predominantly voted for Imamgolu on March 31; and there is no reason for them to change sides,” says Can Seluki, general manager at Istanbul Economics Research, a polling and advisory firm. “The AKP and Yildirim have tried to strategise to win the Kurdish HDP voters over. But their small gestures are far from changing the vote.”

Mr Erdogan has been moving steadily towards hardcore Turkish nationalism, partnering with the ultra-right Nationalist Movement Party in a move that has turned off Kurds as well as the smattering of liberals who once supported the AKP.

Turkey launches discount food banks ahead of elections

“They realise that of those Kurds who supported the AKP in previous elections, a large proportion did not vote on 31 March,” says Mesut Yegen, a professor of political sociology at Istanbul Sehir University.

“It’s now a bit late – the AKP’s new attitude maybe changed the minds of a few conservative Kurds, but it also motivated those Kurds that voted for HDP.”

Days before the election at the Istanbul headquarters of the HDP, volunteers were unpacking boxes full of accreditation papers for vote monitors.

Even though it is fielding no candidate in the race, some 15,000 HDP supporters and affiliated lawyers are signing up to monitor the voting process and ballot boxes to prevent cheating against the CHP candidate, according to the party’s Istanbul co-chair Esengul Demir.

‘This time we are more explicit. We are working as if the HDP is in the election’ Esengul Demir, HDP co-chair in Istanbul

They have also dispatched volunteers into the neighbourhoods.

“A significant percentage of Kurds didn’t vote on 31 March,” she told The Independent.

“Our target is to reach those people.”

The new dynamic represents something of a sea change for Turkey. The CHP, established by modern Turkey’s founder Mustafa Kemal Ataturk, had long been considered hostile to both Kurds and pious Muslims.

But it has sought to reinvent itself in recent years.

Mr Imamoglu frequently plays up his religious credentials, and has sought to reach out to Istanbul Kurds.

Ms Demir says that HDP officials are now in touch “from time-to-time” with CHP counterparts. They urge Mr Imamoglu to “watch his language” and avoid strident nationalistic rhetoric. “He has used more positive rhetoric,” she says.

“In 31 March elections we merely pointed to Imamoglu,” she says.