She was the latest in a series of suspected IS sympathisers detained in Spain since last year over security fears.
Police said she was suspected of recruiting other women via the Internet to the group, also known as Daesh, which has claimed numerous kidnappings and executions.
At the time of her arrest early today in the coastal town of Gandia near Valencia, she "was making the last preparations for her journey" to Syria, a police statement said.
More than 100 people from Spain are suspected of having joined jihadist fighters in Iraq and Syria, and authorities fear they may return to launch attacks.
More From This Section
In March 2004, Al-Qaeda inspired bombers blew up four packed commuter trains in Madrid, killing 191 people.
More than 20 people including various Moroccans were convicted of that attack.
Police said the woman detained today was Moroccan but had lived for a long time in Spain.
"She spread jihadist ideology on the Internet, justifying terrorist acts and spreading videos that glorified executions of people," it said.
"She had focussed her online activity on recruiting women to go and swell the ranks of Daesh.