The acting head of the U.S. Department of Homeland Security has ordered an investigation into reports that Border Patrol agents have been posting offensive anti-immigrant comments and threats against lawmakers on a private Facebook group.

The move was announced amid mounting criticism of the Trump administration's handling of a humanitarian crisis along the U.S.-Mexico border, with lawmakers and government investigators warning of dangerous conditions in migrant detention centers.

"Reporting this week highlighted disturbing & inexcusable social media activity that allegedly includes active Border Patrol personnel," acting DHS head Kevin McAleenan said on Twitter on Wednesday, calling the reported comments "completely unacceptable."