Police have arrested a Spanish paedophile who had his pardon revoked by Morocco's King Mohamed VI after it sparked protests in the north African country, the interior ministry in Madrid said.

Daniel Galvan, who was convicted of raping 11 children aged between four and 15 and sentenced in September 2011 to 30 years in prison in Morocco, was detained in Murcia in southeastern Spain, an interior ministry spokesman was quoted as saying by the AFP news agency.

Galvan, who once worked at the University of Murcia, will be taken to Madrid "in the coming hours" where he will be brought before Spain's top criminal court, the National Audience, which will decide his fate, the spokesman added.

Earlier on Monday, King Mohamed sacked the country's prison chief after an inquiry blamed his department for Galvan's release.

"The inquiry concluded that the said administration inadvertently provided erroneous information about the criminal record of the prisoner in question when requested by the royal court," a palace statement said on Monday.

Pardon revoked

The king revoked the pardon on Sunday.

The Spanish government has said it is in talks with Morocco regarding Vina's fate.

Galvan was among 48 Spanish prisoners pardoned by the king and freed last week from jail in response to a request from Spanish King Juan Carlos, who visited Morocco in mid-July.

A royal palace statement said the king had been unaware of the nature of Galvan's crimes and had ordered a probe into his release.

The pardon sparked outrage in Morocco, which has seen several high-profile paedophile arrests in recent months.

"This move now by the king revoking the pardon is seen as the king taking the initiative... he revoked the pardon, he instructed his ministers to negotiate with the Spanish," said Al Jazeera's Menem El Amrani, reporting from Rabat. "The move is seen as trying to calm down the street."

On Friday night, baton-wielding police dispersed several thousand people who tried to protest in front of the parliament in Rabat.

Sit-ins planned for Casablanca on Tuesday and Rabat on Wednesday were still due to go ahead.