MADRID - The father of an Ivory Coast boy caught being smuggled into Spain in a suitcase last month has been freed on bail, allowing the family to be reunited.

A court ordered Ali Ouattara freed Monday hours after his 8-year-old son was allowed leave a youth centre where he was cared for after being discovered May 7 by border police in Spain's North African enclave of Ceuta. The boy had been hidden in a suitcase carried by a Moroccan woman not related to the family.

Police images of the scanned case, showing the boy curled up inside, drew international attention and highlighted the harrowing plight of migrants trying to reach Europe.

Ouattara, who lives with his Ivory Coast wife - the boy's mother- legally in Spain, said through his lawyers he knew nothing of the suitcase plan, believing his son was to be brought in with a visa. He was arrested entering Ceuta hours after the boy was discovered.

The Moroccan woman remains in detention.

The father was allowed to leave jail after his wife paid 5,000 euros ($5,650) in bail at the court in Ceuta.

Francesco Luca Caronna, a member of the law firm acting for the family, said Tuesday that Ouattara remains charged with human rights abuse against a foreign citizen.

“If he had known his son was to be brought in in a case he would never have allowed it,” said the lawyer. “He is a victim of migrant traffickers.”

Ouattara must surrender his passport and appear before the court each month until the trial, which is not expected for several months.

The father and mother live legally on the Spanish Canary Island of Fuerteventura and had been trying to bring over their children, according to Caronna.

The lawyer said an 11-year-old daughter was allowed in recently but Ouattara's monthly salary fell short of the amount required for two children. It was then that the father set about looking for a visa, Caronna said.

Spanish authorities last month granted the boy a temporary residence permit.