ISTANBUL/ANKARA - Six people were killed on Sunday in clashes between groups backing rival candidates in Turkey's municipal elections, which turned into a referendum on the rule of Prime Minister Tayyip Erdogan.

Security officials said four people were killed in a gun fight between two families in the village of Yuvacik in the eastern province of Sanliurfa, which borders Syria. Such clashes have occurred at previous local elections.

In Hatay province, also bordering Syria, two people died in a gun-battle between relatives of two candidates in Golbasi village, the officials said. Candidates in the voting for these local officials are not party-affiliated.

Tensions rose in Turkey in the build-up to the elections, with Erdogan trying to fight off graft allegations and stem a stream of damaging security leaks.

Erdogan looks set to win Sunday's municipal elections that have become a crisis referendum on his 10-year rule as he tries to ward off graft allegations and stem a stream of damaging security leaks.

Erdogan and his Islamist-rooted AK Party blame the leaks on "traitors" embedded in the Turkish state and he has been criss-crossing the nation of 77 million during weeks of hectic campaigning to rally his conservative core voters.

"They are all traitors," Erdogan said of his opponents at a rally in Istanbul, Turkey's commercial capital, on Saturday. "Let them do what they want. Go to the ballot box tomorrow and teach all of them a lesson ... Let's give them an Ottoman slap."

Erdogan has purged some 7,000 people from the judiciary and police since anti-graft raids in December targeting businessmen close to him and sons of ministers. He blames this on US-based Islamic cleric Fethullah Gulen, a former ally, who he says is using supporters in the police to try to topple the government.

AK's main opposition, the Republican People's Party (CHP), portrays Erdogan as a corrupt dictator ready to hang on to power by any means. Capture of the capital Ankara or Istanbul would allow them to claim some form of victory.

As voting got underway in western Turkey at 8 a.m. (0600 GMT), an hour later than in the east, some voters subscribed to Erdogan's belief that he is the victim of a plot to unseat him.

"You have to look at why they want to unseat the government now. Turkey is a new state, it is getting stronger and the big countries don't want that," said Vahap Selbuk, 20, a student preparing for university entrance exams.

On a sunny morning at a school in the central Istanbul commercial district of Sisli, others saw the election as an opportunity to express their opposition to Erdogan's government.

"We expect a ray of hope in the elections. Even if the AK Party vote doesn't fall that much, we expect them to lose big cities at least. If not we're thinking of living abroad," said Alper Palabiyik, 30, a financial adviser.

"It will be a long night for us but a longer night for that dictator," he said. Voing ends at 5 p.m.

AK, which swept to power in 2002 on a platform of eradicating the corruption that blights Turkish life, hopes on Sunday to equal or better its 2009 vote of 38.8 percent and markets have steadied this week in expectation of such a result.

A vote of less than 36 percent, not considered likely, would be a huge blow for Erdogan and unleash AK power struggles. A vote of more than 45 percent, some fear, could herald a period of harsh reckoning with opponents in politics and state bodies.

Sinan Ulgen, head of Istanbul's Edam think-tank, said he hopes the polls may bring stability and clarity may prove unfounded.

"We have arrived at the stage where the opposition now challenges Erdogan's legitimacy to rule not on the basis of electoral support, of him losing popular support, but arguing that he is no longer eligible and fit to rule until he fully answers allegations against him of corruption," he said.

"This is a new era for Turkey."

"ALLIANCE OF EVIL"

Erdogan formed AK in 2001, attracting nationalists and center-right economic reformers as well as religious conservatives who form his base. Since his 2011 poll victory he has in his statements moved more towards these core supporters.

The graft scandal, also involving anonymous Internet postings of tapped state communications implicating Erdogan in corrupt actions he denies, was all but eclipsed in recent days by the leaking of a recording of a top-level security meeting.

In the recording, the intelligence chief, foreign minister and military commanders discuss possible armed intervention in Syria. A senior government official described the leak as one of the biggest crises in modern Turkey's history, threatening further sensitive disclosures.

The leak seemed particularly to target MIT intelligence chief Hakan Fidan, possibly Erdogan's closest confidante.

Officials suggest Gulen's Hizmet network released the recording, giving an alarming sense in Ankara that government has only tentative control of state bodies and part of the security apparatus while power struggles play out.

Hizmet denies orchestrating the leak scandal and maneuvering to control the state apparatus, but those close to the network say they fear a heavy crackdown after the elections.

Erdogan, who describes Hizmet as a terrorist organization in an "alliance of evil" with major opposition parties, seems likely to act quickly to tackle the leaks and he may have given a first indication of that in his speech on Saturday.

Please LIKE our Facebook page - it makes us stronger