TRIPOLI (Reuters) - Libya should resist rushing into elections this year because the country is too violent and authorities cannot guarantee freedom of assembly or free speech essential for a vote, Human Rights Watch said on Wednesday.

Potential contenders on both sides of Libya’s main political divide have called for a vote to resolve an impasse in which the government in the capital has limited authority and largely depends on armed groups for security.

The United Nations helped set up the government in 2016 and says it would like to see elections this year if security and legislative conditions are met - a call that U.N. Libya envoy Ghassan Salame reiterated on Wednesday.

A voter registration process began in December but no election dates have been set and it is unclear how local, parliamentary and presidential polls would be sequenced.

The last parliamentary elections in 2014 led to rival governments being set up in Tripoli and the east, backed by competing, loose armed alliances.

In the past week, there have been deadly clashes between armed factions in the cities of Sabha in the south and Derna in the east. In Tripoli several prominent figures have been kidnapped, including the military prosecutor.

“Libya today couldn’t be further away from respect for the rule of law and human rights, let alone from acceptable conditions for free elections,” said Eric Goldstein, deputy Middle East and North Africa director for the rights group.

“The authorities need to be able to guarantee freedom of assembly, association and speech to anyone participating in the elections,” he said in a statement.

One precondition for elections is a judiciary that can resolve disputes, but it is in a state of collapse, HRW said.

“Armed groups have threatened, intimidated, and attacked judges, prosecutors, lawyers, and government officials. Law enforcement and criminal investigation departments around the country are only partially functional, often lacking the ability to execute court-issued summons and arrest warrants.

“Libya’s courts are in no position to resolve election disputes including on registration and results.”

The statement came as the U.N. human rights office said armed groups continued to execute and torture civilians in Libya with almost complete impunity.

Briefing the U.N. Security Council on Wednesday, U.N. envoy Salame said an elected government is needed to stabilise and unify Libya. “For the United Nations, working for the conduct of fair free, credible elections before the end of the year is at the top of our priorities,” he said.

“It is vital that before these elections take place we are certain that they will be inclusive and their results accepted.”

The United Nations has pointed to the voter registration process as evidence of Libyans’ enthusiasm for elections. Since December, more than 923,000 voters have registered, according to the electoral commission, and more than 2.4 million are now registered nationwide.

However, analysts say this does not necessarily presage a high turnout, given security challenges and a voting population estimated at between 4.2 and 4.5 million.