By James Copnall
BBC News, Rabat
Internet sites were set up in defence of Mr Erraji after his conviction
A Moroccan blogger who was sent to jail for criticising the king has been cleared on appeal.
Mohamed Erraji had written an article for an online newspaper suggesting that some royal practices did not help the development of the country.
The appeals court in the southern city of Agadir overturned the conviction and dropped all charges against Mr Erraji.
Morocco has allowed greater freedom of expression in recent years, but there are still limits on what can be said.
Mr Erraji's had originally been sent to prison for two years, and given a fine of 5,000 dirhams ($635; £350) for lacking the respect due to the king.
He had written an article in which he said King Mohammed VI's charity towards the people encouraged them to look for handouts rather than to work hard.
In particular, he criticised the practice of giving lucrative licences to run taxis to those able to approach the king to beg for them.
The appeals court said proper procedure had not been followed in the initial trial.
However, as many international and local organisations have accused the Moroccan justice system of not being free and fair, the suspicion will be that the outcry provoked by the case proved too embarrassing to the Moroccan authorities.
Moroccan newspapers wrote critical articles after Mr Erraji's conviction, and internet sites were set up to defend him.
Morocco undoubtedly allows much greater freedom of expression than it used to, but the monarchy remains a taboo subject.
Earlier this year, a young engineer, Fouad Mortada, was sentenced to three years in prison in another internet case concerning the monarchy.
He had created a fake internet profile on the website Facebook, in the name of the king's brother.
Mr Mortada was later released after he received a royal pardon.