It follows global shock over the atrocities suffered in Libya by African migrants, many of whom are trying to reach Europe, brought home by a CNN report showing people being sold as slaves.
The council said it "condemns such actions as heinous abuses of human rights which may also amount to crimes against humanity," according to the statement, which was drafted by Great Britain.
It added it was essential "to transfer detainees to State authorities and encourages the Libyan authorities to reinforce their cooperation with international organization and UN agencies and to ensure humanitarian access to detention centers."
"The Security Council emphasizes that a stable Libya is the only way to help improve the living conditions of all people in Libya, including migrants," the resolution added.
It is rare for a UN resolution to single out a specific country when talking about slavery, a phenomenon that is normally discussed in the context of global rights abuses.