GENEVA - Armed groups execute and torture civilians in Libya in almost complete impunity seven years after the revolution that toppled Muammar Gaddafi, the United Nations human rights office said on Wednesday.

Libyans and migrants are often held incommunicado in arbitrary detention in appalling conditions, and reports persist of captured migrants being bought and sold on "open slave markets", it said in a report to the Human Rights Council.

Libya is split between rival governments in the east and west while ports and beaches are largely in the hands of armed groups who smuggle mainly African migrants onto boats heading for Italy and Europe.

"Extrajudicial and unlawful killings are rampant," Andrew Gilmour, U.N. Assistant Secretary-General for Human Rights, told the Geneva forum.

A video emerged on Jan 24 purportedly showing a special forces field commander Mahmoud al-Werfalli shooting 10 blindfolded men kneeling with their hands tied behind their back, he said. Reuters could not independently confirm the gunman's identity. 

Werfalli, a special forces commander attached to Khalifa Haftar's Libyan National Army (LNA), has been indicted by the International Criminal Court (ICC) for allegedly overseeing the summary execution of several dozen prisoners.

"In what has become an increasing pattern in and around Benghazi over the last two years, more bodies with signs of torture and hands bound were found in the streets," Gilmour said.

Armed groups are "the main perpetrators of grave human rights violations and act with almost complete impunity", he said.

Detention centres run by armed groups, "including those with links to ministries" have the worst record, he said.

Adel Shaltut, charge d’affaires at Libya's mission to the U.N. in Geneva, said: "Libya is a victim of illegal migration, it is only a transit country and cannot shoulder all responsibilities. Our coast guards and border guards do not have capacity to face organised crime and terrorism."

The European Union said that migrants and activists were subjected to "unlawful detentions, abductions, torture, forced labour and sexual and gender-based violence".

"We are deeply also concerned about reports of migrants and refugees allegedly being sold as slaves and call on the Libyan authorities to investigate and hold persons responsible for those acts accountable," said EU diplomat Carl Hallergard.

Hanan Salah, Libya researcher for Human Rights Watch, denounced "raging impunity", adding: "A political settlement and any semblance of rule of law seem elusive."

She urged the Council to appoint an independent expert on the country, adding: "Given the gravity of the situation on the ground in Libya, how can this Council justify the lack of a dedicated monitoring and reporting mechanism".

(Reporting by Stephanie Nebehay Ecditing by Richard Balmforth) ((Stephanie.Nebehay@thomsonreuters.com; +41 58 306 2161; Reuters Messaging: stephanie.nebehay.thomsonreuters.com@reuters.net; twitter @StephNebehay))