A second migrant, also from Guinea, was found hidden inside a tiny space behind one of the seats inside the car.
They were identified only by their initials, T.D and A.B.
Spanish police became suspicious after noticing that the driver of the car, who was not identified, appeared nervous.
The driver was arrested. The two migrants were taken to a local hospital suffering from cramp and dehydration. Doctors said they could have died had they been inside the confined spaces much longer.
The case recalled that of a young boy who in May was found hidden inside a suitcase in an attempt to enter Ceuta from Morocco.
The eight-year-old boy from Ivory Coast, named Abou, was discovered after the suitcase he was squeezed into was put through an X-ray scanner.
The suitcase was wheeled through the Tarajal pedestrian crossing on the frontier by a 19-year-old woman.
When police opened up the case, the boy peered up at them and said, in French: "My name is Abou."
Police said the smuggling attempt was highly dangerous and that it "could have ended in tragedy."
Spain's border police caught more than 12,500 immigrants last year, most of them in Ceuta and Spain's other North African enclave, Melilla.
- The Telegraph