Killings and torture are being committed with impunity by all sides in Libya, according to a UN report.
Human rights violations carried out by armed groups battling for control of the country could amount to war crimes, the report says.
Victims include detainees, journalists and human rights activists. Scores of people have been tortured and killed.
Libya, fragmented since the overthrow of Muammar Gaddafi in 2011, now has rival militia-backed parliaments.
There are hundreds of different armed groups and the chaos has allowed so-called Islamic State to gain a foothold.
The report by the Office of the UN High Commissioner for Human Rights on Libya describes a country descending into violent chaos.
Other tactics documented in the report include indiscriminate attacks on civilians, rape and other sexual violence.
This is all happening in a climate of "complete impunity", the report says, made worse because Libya's justice system has collapsed.
The crimes are committed by "a multitude of actors - both state and non-state".
The UN says the report is the most comprehensive to be carried out in Libya in recent years.
Interviews were carried with hundreds of people inside the country and with Libyans forced to flee to Italy, Tunisia and Egypt.
The report lists in detail:
- Unlawful killings: Abuses reported in all conflict areas and by most major armed groups since 2014, including executions of captives or those perceived to be voicing dissent
- Indiscriminate attacks: Attacks also appear to have been indiscriminate, impacting Benghazi, Tripoli, Warshafana, the Nafusa Mountains area, and in the south
- Torture and ill-treatment: Widespread, particularly in detention facilities, with reports of deaths in custody, beatings, solitary confinements, electrocutions, deprivation of adequate food or water, threats of a sexual nature and extortion
- Arbitrary detentions: Since 2011, thousands of individuals remain in detention, the vast majority without proper examination of their cases - some held in secret or unrecognised facilities operated by armed groups
- Gender-based violence and discrimination against women: Attacks on women activists, including assassinations
The report says that evidence of sexual violence is difficult to document because of fear of retaliation, stigma, family pressure or trauma.
It says that the plight of children, migrants, human rights defenders and journalists has been made worse by "the systemic failures of the justice system".
The UN says the international criminal court should be able to carry out investigations and prosecutions, and protection programmes should be set up for victims and witnesses.
It also calls on the UN Security Council to consider economic sanctions against Libyans found responsible for war crimes and crimes against humanity.