Bahoumou Totopa, 33, arrived on Spain's southern coast on an inflatable dinghy in April while her son Abdurrahmane entered the country's North African enclave of Melilla the previous month with his aunt.
Totopa was not allowed to contact her son, who was taken in by child protection services in Melilla, until she could prove she was his mother, legal NGO Women's Link said.
After a positive DNA test Totopa was able to pick up her son in Melilla and take him to Jerez de la Frontera, where she is living in a migrant reception centre, Women's Link said.
After several failed attempts to persuade Spanish authorities to let Totopa contact her son, Women's Link turned to the European Court of Human Rights.
The Strasbourg-based court on October 19th urged Spain “to adopt any kind of interim measures (e.g. visits, contact by phone, etc) pending the DNA test results”.
“I need my son, it's not at all easy for a child to be snatched like this from his mother,” Totopa said in a video released in October by the charity.
Over 1,600 children, almost half of them Syrians, arrived in Spain illegally in 2016, according to UN figures — about 12 percent of the total number of migrants who arrived in Spain last year.
Human rights groups regularly criticise the treatment given to migrants who arrive in Melilla and Ceuta, another tiny Spanish territory in North Africa, which have the European Union's only land borders with Africa.