Turkish Prime Minister Tayyip Erdogan declared victory in local polls that had become a referendum on his rule and said he would "enter the lair" of enemies who have accused him of corruption and leaked state secrets. "They will pay for this," he said.

Erdogan spoke from a balcony at his AK Party headquarters to thousands of cheering supporters as early results showed it winning some 44-46 percent of the vote, and the opposition CHP trailing with 23-28 percent.

Erdogan accuses a U.S.-based Islamic cleric, a former ally, of mounting a smear campaign using a network of followers in the police force to concoct a corruption case against him. In response he has purged the police force of thousands of members.

Last week the crisis reached a new level when a secret top-level security meeting about Syria was taped and posted on YouTube. The cleric, Fethullah Gulen, denies any involvement in the security leak or the corruption investigation.

"This is the wedding day of the new Turkey," Erdogan said. "Today is the victory day of the new Turkey, 77 million united and together as brothers."