King Mohamed VI of Morocco on Sunday revoked a pardon granted to a Spanish serial paedophile whose release sparked angry protests in the kingdom, a palace statement said.
The king "has decided to withdraw the pardon previously accorded to Daniel Galvan Vina", said the text of the statement, published by the official MAP news agency.
Although several media reports have said Vina has left the country, the agency said the justice minister would discuss with Madrid "the next step after the pardon's revocation".
The king's announcement came shortly before a large demonstration was due to take place against the pardon, after baton-wielding police dispersed demonstrations on Friday.
Vina, said to be in his 60s, was pardoned by the king and freed last Tuesday from jail in Kenitra, north of the capital. He had been sentenced in September 2011 to 30 years in prison.
Vina, convicted of raping 11 children aged between four and 15, was among 48 Spanish prisoners released in response to a request from Spanish King Juan Carlos, who visited Morocco in mid-July, the justice ministry said.
Earlier, the palace said in a statement carried on MAP that the king had been unaware of the nature of the man's crimes and had ordered a probe into his release.
The investigation should "determine the responsibilities and the failures that led to this regrettable release", the statement said.
"The king was never informed -- in any way or at any time -- of the seriousness of the abject crimes of which the person concerned was convicted," the palace added.
"It is clear that the sovereign would never have consented" to his release, given the "monstrous crimes" he committed, the statement concluded.