Updated

The secular mayor of Jerusalem has won a second term in a hard-fought campaign that saw him fending off a challenge by a candidate backed by two of Israel's biggest kingmakers in the centerpiece race of nationwide municipal voting.

"Jerusalem won!," Mayor Nir Barkat wrote on his Facebook page early Wednesday. About an hour later Barkat gave a victory speech to supporters and said the election had been a "tough and complex" race.

He called for unity in working to better the city and said "Jerusalem has room for everybody."

Challenger Moshe Lion conceded defeat at about 2:30 a.m. Wednesday.

With 70 percent of the vote counted in Tuesday's election, Barkat held a commanding lead of 55 percent to 42 percent over Lion. Israeli TV stations said the 14,000-vote margin was all but insurmountable.

Barkat, a successful former high-tech entrepreneur, was elected in 2008 in a victory seen as a blow to years of dominance by ultra-Orthodox Jews over the city's affairs. His term, characterized by high-profile tourism and cultural projects meant to boost the economy and halt an exodus of secular residents from the city, was generally seen as a success.

But Lion, a former director of the prime minister's office, was backed by two key politicians elbowing to reclaim their former political glory.

Lion's allies, former Foreign Minister Avigdor Lieberman and Ariyeh Deri, leader of the ultra-Orthodox Shas Party, both had much at stake.

Lieberman's party lost seats in the last national election, and he is awaiting a verdict next month in an ongoing corruption trial. Shas was once a kingmaker in Israeli politics, but it no longer sits in the ruling coalition, and it faces a leadership crisis following the recent death of its spiritual leader, Rabbi Ovadia Yosef.

Critics say Lion is a political novice who relocated to Jerusalem recently to run for the job. In a recent TV interview, he failed to answer basic questions about the city's cultural and political landmarks.

Lion failed to benefit from the low turnout. Only 26 percent of Jerusalemites voted, compared to a 43 percent turnout nationwide, according to media reports.

Lion, himself an observant Jew, was counting heavily on ultra-Orthodox voters. In a last-minute blow to Lion, two leading ultra-Orthodox rabbis declined to endorse him late Monday, telling their adherents to vote according to their conscience.

Jerusalem is one of the world's most difficult cities to govern: It lies at heart of the Israeli-Palestinian conflict and is the epicenter of secular-religious battles for control in Israel.

It is also Israel's largest city, and its 800,000 residents include secular, modern Orthodox, and ultra-Orthodox Jews as well as Palestinians.

The Arab population lives almost entirely in east Jerusalem, the sector captured by Israel in 1967 and claimed by the Palestinians as their capital. Jerusalem's old city in the eastern sector is home to a compound sacred to Jews as the Temple Mount and to Muslims as the Noble Sanctuary. Jews revere it as the site of their two biblical Temples. Muslims regard it as Islam's third-holiest site.

Jerusalem's Arab community could in theory swing the city election, but — as in previous years — it is boycotting this year's vote to protest Israel's control of the city. The international community does not recognize Israel's control of east Jerusalem.

As he cast his vote on Tuesday, Prime Minister Benjamin Netanyahu reiterated his stance on the city's future.

"So long as I am prime minister, Jerusalem will remain our united capital. That's how it will be," he said.

The Israeli government is responsible for peace talks with the Palestinians. While the Jerusalem mayor has no official say in the city's political future, he can affect local Arab-Jewish issues such as building permits, construction, education and public services.

Barkat says that in his five years as mayor, he has halted the exodus of tens of thousands of secular Jerusalemites, revived the city's cultural life and improved the quality of life for its Arabs.

But surprisingly, Jerusalem remains one of the poorest cities in Israel, and Lion says Barkat placed too much emphasis on cultural activities at the expense of affordable housing and sanitation. Dovish Israelis have also accused Barkat of neglecting east Jerusalem's Arabs and having a cozy relationship with hard-line settler groups.

In other cities in Israel, mayoral contenders were campaigning Tuesday to make election history.

Lawmaker Nitzan Horowitz was looking to unseat popular Tel Aviv mayor Ron Huldai to become the country's first openly gay mayor, and in the Arab city of Nazareth, firebrand lawmaker Hanin Zoabi was running against a powerful incumbent in a bid to become the country's first female Arab mayor.

One race in the northern Israeli town of Nesher turned into a family affair: Mashiach Amar was running against his brother David, the town's mayor.

Police spokesman Micky Rosenfeld said officers are investigating several violent incidents surrounding the elections.

On the eve of the vote, a lawyer affiliated with elections in the city of Lod was shot and wounded by gunmen.

In the Arab city of Sakhnin, a brawl broke out between dozens of voters at a polling station. And at a station in Jerusalem a man pulled out a knife and waved it around yelling. It wasn't clear what he was shouting about and he ran away without causing harm.