A hard-line Sunni politician has won local elections in Lebanon's second-largest city of Tripoli in a defeat of long-established Sunni leaders that risks reviving tensions among rival sectarian groups.

The municipal elections under way nationwide for a month are an important indicator of sentiment in Lebanon, where a political crisis has twice forced the postponement of parliamentary elections that should have been held in 2013.

A list backed by emerging Sunni politician Ashraf Rifi won a majority of seats on the council elected in Tripoli on Sunday, defeating an alliance backed by Sunni leaders including former Prime Ministers Saad al-Hariri and Najib Mikati. Preliminary results indicated that none of the 24 seats on the council were won by members of the Christian or Alawite communities, which were both represented in the outgoing council.

One analyst described the result as a sign of growing militancy in the mostly Sunni city that is a historic bastion of Sunni Islamist groups.

A Christian MP from Tripoli resigned in response to the result. In a statement, Robert Fadel said the outcome had marginalized "more than one fundamental component" of the council and called for a review of the election law so that "it doesn't unintentionally turn into a source of strife."

Rifi is a former police chief who resigned as justice minister recently to protest the power over the government held by Hezbollah, the heavily armed Shiite group backed by Iran. Analysts say he was seeking to stake out a position as an uncompromising Sunni rival to Hariri by quitting the government.

Rifi, who comes from Tripoli, has heaped criticism on Hariri, son of the assassinated statesman Rafik al-Hariri, for nominating a Hezbollah ally to fill the vacant presidency. Speaking at a televised news conference Monday, Rifi said Hariri's decision to back Maronite Christian politician Suleiman Franjieh for that post was unacceptable to his constituents in northern Lebanon.

Rifi said his Sunni rivals had failed to grasp a shifting mood in the region as Sunni power Saudi Arabia takes a tougher position against Shiite Iran. They had also failed to grasp the weakness of the Syrian government, he said. Both Tehran and Damascus are allies of Hezbollah.

"Nobody knew that the Sunni mood in Lebanon would no longer accept surrender or complacency. It wants its right as citizens," Rifi told Reuters.

He also called for coexistence in Tripoli, adding that his list included Christian and Alawite candidates who had not appeared to win seats, though the counting was not over.

The turnout appeared low, with initial indications of just over a fifth of voters taking part, according to activists working with the campaigns. Estimates for the number of seats won by Rifi's list ranged from 16 to 22.

Tripoli has been a focal point of instability linked to the Syria conflict since it began in 2011. Sunni Islamists waged an armed insurrection with the army in Tripoli in 2014, and fighting has also erupted in the city between members of the Sunni and Alawite communities. The last major violence was a suicide bomb attack in January 2015.

Nabil Boumonsef, a political commentator with An-Nahar newspaper, said: "It is certain that Ashraf Rifi won under the slogan of extremism. The interesting thing is that a democratic process has resulted in the new slogan of extremism in Tripoli."

Writing on Twitter, Hariri called for cooperation for the sake of the city. "We confirm respect for the democratic will of the people of Tripoli who have picked their new municipal council," he said.