The eight-year-old was discovered inside a suitcase in the rear seat of a car at the Spanish port of Tarifa.
Agents of Spain's Civil Guard police force were carrying out a routine inspection of the vehicle when they found the girl inside the luggage, the force said in a statement.
Video: Spanish Civil Guard
She was in good health, and was transferred to a children's home in the nearby town of La Línea de la Concepción.
Her father, the driver of the vehicle, was taken into custody but has since been released with charges pending.
He had entered Spain with a legal work permit and now faces a fine.
Both he and his daughter will be allowed to remain in the country, the UK's Daily Mail reported on Wednesday.
This is the second such incident in recent weeks.
In early March, Spanish police caught a sub-Saharan immigrant hiding inside a suitcase as his carrier attempted to drag him across on foot into Spain’s African enclave of Melilla.