The migrants - a woman from Congo and three men from Guinea - were found on Sunday when police at the crossing between Morocco and the Spanish territory of Melilla grew suspicious and searched the vehicle.
They were crammed inside a "hermetic false bottom with no ventilation" located below the front seats of the minivan, police said in a statement.
The woman began yelling in French: "Please, please, get me out of here. I'm scared. I don't feel my legs and my feet are really swollen!".
Firefighters had to use an electric saw and other tools to free the migrants who were all in "very poor physical shape" and in need of medical care.
Police said all four migrants, aged between 21 and 27, are now in good health.
Officers arrested the driver and only other occupant of the vehicle, a Moroccan man.
Temperatures on Sunday neared 30 degrees Celsius (86 Fahrenheit) in Melilla, which has one of only two land borders between Africa and the European Union.
The other is at Ceuta, another Spanish territory nearly 400 kilometres (250 miles) away on the north coast of Africa.
The two territories have for some years been a flashpoint for African migrants trying to enter Spain and seek a better life in Europe, with authorities stepping up security by strengthening border barriers.