A spokesman for the Interior Ministry´s office in Ceuta said the vehicle broke through a metal gate on the Spanish side of the border around 3 a.m. (0300GMT). It was not clear whether it had broken through other fences on the Moroccan side.
The official said the 52 migrants were all from sub-Saharan countries. They were only identified as 34 men, 16 women and two minors. Four were treated in a Ceuta hospital for minor injuries suffered in the crossing.
The driver was a Moroccan citizen and has been detained, said the official, who was speaking on condition of anonymity in line with government rules.
It was not first time that vehicles carrying migrants have crashed through the border but the spokesman said Monday's incident involved the biggest number so far.
Migrants gathered in Morocco normally try to scale the 6-meter (19.5 foot) wire fences that separate Ceuta from Morocco. Ceuta is one of two Spanish enclaves on the Moroccan coast.
The spokesman said the migrants would be accommodated in a temporary holding center while their expected asylum petitions are studied.
Once in Ceuta, the migrants normally apply for asylum or wait for an opportunity to travel to mainland Spain.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.