"People cannot profit from this evil trade with impunity," British Ambassador Matthew Rycroft said.
The resolution, negotiated off and on for months, is under Chapter 7 of the UN Charter, which means it can be militarily enforced.
African members of the 15-member council had expressed concern about that.
The resolution also authorises the European Union and individual nations to board vessels "with a view to saving the threatened lives of migrants or of victims of human trafficking."
The resolution authorises the search and seizure operation for one year. It says migrants "should be treated with humanity and dignity."
Council diplomats have said migrants on vessels that are searched and seized would be taken to Italy.
The resolution underscores that the intention is not to prevent individuals from exercising their human rights or prevent them from seeking protection.
The EU initially wanted a naval operation in Libyan territorial waters and along its coast, but Libya objected. Its approval is needed for such an operation, but the North African country remains divided between two rival governments that the UN is trying to lead into a final peace deal.
The original draft of the resolution would have authorised the destruction of the vessels, but the resolution states that any action on disposal of a seized vessel must be taken in accordance with international law "with due consideration of the interests of any third parties who have acted in good faith.
