A West African migrant entered the Spanish territory of Ceuta from Morocco curled up next to a car engine and another was hidden behind the back seat of the Mercedes-300 car.
Spanish police found the pair late on Sunday during a customs check at El Tarajal, near the Moroccan border.
The two men from Guinea got first aid, having suffered from a lack of oxygen, Spain’s Guardia Civil police said.
Sub-Saharan Africans often try to enter Ceuta, as a gateway to the EU.
The Mercedes 300 was found to have false number plates. Police detained two Moroccan men who were in the car when it was stopped.
It is not clear how long the man in the engine compartment had been inhaling noxious fumes
The two illegal migrants did not have any papers, and were identified in the statement only as “TD and AB from Guinea Conakry”. They are also under official investigation now.
Last month, a Moroccan man suffocated to death in a suitcase after his brother tried to smuggle him to mainland Spain aboard a ferry from Melilla.