The investigation began on April 19 after the parents, both Romanian, reported their daughter missing.
But after speaking to several witnesses, police began to suspect the girl had been sold by her parents to a Romanian man who was living in Lucena del Puerto, in Huelva.
A European-wide search tracked the girl down to Obrežje in Slovenia.
She was found travelling towards Romania with an older man, whose father allegedly bought her.
Investigators believe the man’s father had arranged with the girl’s parents to buy her for his son, in exchange for €5,000 and a van.
Sources told El Pais the parents only went to the police after the buyer did not pay out the amount agreed.
The girl has been brought back to Spain.
Guardia Civil have requested a European order to detain the man who took the girl, known only as V.M., and who was arrested in Romania in May.
He faces charges of human trafficking, sexual abuse of a minor under 16, and inducing a minor to abandon home.
The girl’s parents and father of V.M. have also been arrested and charged with human trafficking.