UPDATE 2-Pro-Kurd party clashes with Erdogan ahead of high-stakes Istanbul vote

* Kurds seen playing key role in outcome of Istanbul election

* 20 years after capture, Ocalan wields influence over Kurds

* Erdogan says Ocalan, former HDP leader in power struggle (Rewrites with HDP statement, Erdogan, outside comment)

By Daren Butler

ISTANBUL, June 21 (Reuters) - Pro-Kurdish political leaders accused Turkish President Tayyip Erdogan on Friday of trying to sow discord among Kurds ahead of a re-run of an Istanbul election on Sunday that is seen as a crucial test of support for Erdogan and his ruling AK Party.

The pro-Kurdish Peoples' Democratic Party (HDP) also reaffirmed its support for opposition mayoral candidate Ekrem Imamoglu who won the March municipal poll. Election authorities ordered a re-run after AKP allegations of poll irregularities, a ruling that has prompted concerns about Turkish democracy.

In an unexpected and ambiguously worded statement, Kurdish militant leader Abdullah Ocalan called for "neutrality" in the Istanbul vote, in comments that could be understood as suggesting Kurds not take part.

Kurdish support was key in helping Imamoglu narrowly defeat the AKP mayoral candidate Binali Yildirim in the March vote. Kurdish voters account for about 15% of Istanbul's 10.5 million eligible voters and many support the HDP.

Just after state-run Anadolu agency released details of Ocalan's hand-written letter late on Thursday, Erdogan speculated in a television interview that the statement pointed to a "serious power struggle" among senior Kurdish leaders.

The HDP's co-leaders Pervin Buldan and Sezai Temelli responded angrily to Erdogan's intervention.

"The effort by President Erdogan to set our party and Mr. Ocalan against each other through a text leaked in an unethical way shows ... how desperate he has become," they said.

"There is no change in the HDP's election strategy and tactical steps," they said in a joint statement.

STILL INFLUENTIAL

Despite being imprisoned on Imrali island near Istanbul for two decades, Ocalan - leader of the outlawed militant Kurdistan Workers Party (PKK) - continues to wield considerable influence among Kurdish HDP supporters.

"The democratic alliance approach of the HDP should not be made a part of current election discussions. The importance of the democratic alliance is that it insists on its neutral position in elections," Ocalan wrote in his letter, dated June 18, when he last met his lawyers.

Erdogan's AKP is trailing in polls and has been struggling to win over Kurdish voters despite softening previous rhetoric on the security situation in the mainly Kurdish southeast of Turkey, a move the HDP says is an election ploy.

The loss of Istanbul, Turkey's biggest city and commercial hub where Erdogan himself once served as mayor, has been a bitter blow for the president as he struggles with an economic recession and other challenges.

Ocalan's intervention came after Selahattin Demirtas, the former HDP leader jailed since 2016 on terrorism charges, sought to rally party supporters behind Imamoglu in a series of tweets.

In his comments on Thursday, Erdogan spoke of "a slide towards a serious power struggle between Ocalan and Demirtas". He also suggested that Ocalan suspected PKK guerrillas based in the mountains of northern Iraq of "treachery" against his leadership.

The PKK is designated a terrorist group by Turkey, the European Union and United States. It launched an insurgency in 1984 in which more than 40,000 people have been killed.

Ocalan's call came weeks after Ankara allowed him to meet his lawyers for the first time since 2011, prompting speculation about possible fresh efforts to end conflict in the region. Turkey's justice minister has denied any such moves.

Erdogan's apparent welcoming of Ocalan's letter has raised eyebrows among some commentators, given that the jailed PKK leader is reviled as a terrorist by most Turks, including the Turkish nationalists in the president's "People's Alliance".

"It begs the question of whether the People's Alliance has resorted to putting its hopes in Ocalan to win the Istanbul election," veteran journalist Murat Yetkin wrote in his blog. (Additional reporting by Ali Kucukgocmen and Humeyra Pamuk; Editing by Jonathan Spicer and Gareth Jones)