Several people have been injured in Morocco during mass protests against the royal pardon granted to a prolific Spanish paedophile.

A mob of thousands of demonstrators attempted to converge on the national parliament in the capital city of Rabat, only to be beaten back by police wielding batons.

It is reported that several reporters and photographers were injured in the chaos, which was mirrored in the cities of Tangiers and Tetouan.

The demonstrations erupted after the decision to pardon Daniel Fino Galvan, a prolific sex offender who allegedly raped children as young as three.

Galvan, a former university professor, was sentenced to 30 years in jail in 2011 by a Moroccan court for raping and filming 11 children aged between three and 15. However, he was pardoned earlier this week at the request of Spanish King Juan Carlos.

Although Galvan has been told to leave Morocco, many people across the country believe the decision to quash his sentence is a grave injustice.

"We are here to know who is responsible for that pardon. It is a shame, they are selling our children," Najia Adib, president of Don't Touch My Children association, told Reuters during the Rabat demonstrations.

"It is a big mistake. We want the annulment of the [Moroccan] king's decision and apologies for the victims' families and the Moroccan people," Abdelali Hamieddine, a member of the dominant Islamist Justice and Development Party (PJD), added.

The street protests were orchestrated by vehement online campaigns, denouncing the government's decision and calling for action in the immediate aftermath of the announcement.

The demonstrators, who clashed with police in front of parliament, were roused by an online petition which attracted more than 20,000 signatures, and urged protesters to stage a sit-in in front of Morocco's key legislative centre.

Twitter and Facebook were also inundated with messages. One respondent, Meryem El Said, tweeted that the pardon "is a second rape for the victims" while blogger Nouhad Fathi asked: "Is this Morocco's way [of reaching] the long-sought [after] target of 10 million tourists a year?"

Morocco's royal palace has yet to comment on the decision to pardon Galvan, although the Justice Ministry has claimed the decision is intended to ensure continued friendly relations with Spain, its nearest European neighbour.