The suspect, named as Samira Yerou, was sent to Spain by Turkish authorities after they caught her trying to illegally enter Syria, Spain's interior ministry said. Spain had issued an international arrest warrant for the woman.
Spanish authorities, who believe Yerou was seeking to meet up with Isis, took her into custody after she flew into Barcelona-El Prat Airport.
Yerou "could have played an important role in recruiting and sending of women sympathisers of the terrorist group in Europe and Morocco," the ministry said.
She was with her three-year-old son when trying to get into Syria. The boy's father filed a complaint when Yerou and the child disappeared from the Spanish city of Rubi, which is near Barcelona, in December.
"The child is in perfect health and has been reunited with his father," the ministry said.
Like many European countries, Spain is battling against the radicalization of young people seeking to join up with IS in Syria and Iraq and it has dismantled several recruitment networks in recent months.
Spanish authorities believe about 100 Spaniards have joined Islamist militants in Iraq and Syria, a relatively low figure when compared with the number of French, British and German nationals who have sought to fight with the group.
Overall, about 550 young women have joined Isis, according to an estimate from London-based think tank the Institute for Strategic Dialogue.