A force allied with Libya's unity government in the people-smuggling hub of Sabratha has detained more than 3,000 migrants, a security official said on Saturday.