Facebook Inc. is once again in hot water for allowing objectionable videos on its website, this time drawing a rare rebuke from a United Nations agency.

The U.N. migration agency hammered the social network for allowing what it said was a “horrifying” video showing gangs in Libya threatening to harm a group of terrified migrants, many from Somalia and Ethiopia. One migrant in the video is lying on his chest with a concrete block on his back, and that the video shows the faces of some migrants without their consent in a way that they can be identified. The smugglers also are issuing threats to the migrants’ families over WhatsApp, a messaging app owned by Facebook, according to Leonard Doyle, spokesman for the International Organization for Migration.

Mr. Doyle said the video surfaced in June, after which his organization issued a press release condemning it. He said that should have prompted Facebook to take down the video.

“On what possible grounds can you show these poor, vulnerable people?” he said in an interview, adding that it was very rare that the U.N. agency would specifically criticize Facebook in this manner. Facebook officials reached out to his agency on Friday to discuss the issue after the Times of London published a story on the video, but the company as of Sunday hadn’t removed the video.

Facebook said it allowed the video to stay up because the footage was shared by a journalist to shed light on human rights violations around the world. The company said part of its role is to be a place where its more than 2 billion monthly users can raise awareness about important issues.