Correction: An earlier version of this editorial incorrectly referred to Morocco’s monarch as King Mohammed IV. The monarch is King Mohammed VI. This following version has been updated.

THIS WEEK the kingdom of Morocco has a chance to make a right turn or a wrong one. The right choice will be more difficult, but in the long run it will pay greater dividends. Morocco should do the right thing and drop the prosecution of Ali Anouzla, one of the country’s most prominent journalists, on charges that are intended only to intimidate him and to silence the media.

Mr. Anouzla was taken from his home in Rabat on Sept. 17 after a Web site he helped to found and edit published an article in Arabic about an al-Qaeda video that attacked King Mohammed VI for presiding over a “kingdom of corruption and despotism” and called on youth to embrace jihad. Mr. Anouzla didn’t directly re-post the video, but he did feature a screen shot and a link to the Web site of the Spanish newspaper El País, which carried a link to the video.

For this, he was charged with “inciting” and “providing material support” for terrorism. He is facing a possible 20-year prison term.

On its face, the charge is absurd. Mr. Anouzla, who has a long record of journalism challenging the authorities, called the video “propaganda” in his report — and rightly saw it as legitimate material for reporting on. By attempting to criminalize Mr. Anouzla’s activity, the monarchy is demonstrating its own insecurity. Instead of treating this material as dangerous, they should be thanking Mr. Anouzla for pointing out the video and using it as a teaching moment for the country about the terrorist movement’s real dangers.

The prosecution of Mr. Anouzla is misguided in another, larger sense. It suggests that King Mohammed is not ready or willing to continue down the promising path he began with democratic liberalization after the Arab Spring. Mr. Anouzla has called on the monarchy to free the public media and guarantee independent journalism. Putting him in prison for reporting on al-Qaeda hardly seems like a step in that direction.

It is obvious that the monarch fears unfettered journalism will raise uncomfortable questions about its rule. Such is the unspoken nightmare of autocrats everywhere. They fear a free press and open debate will undermine their legitimacy. Certainly, a free press can be prickly, unpredictable and independent, but bottling it up just leads to more pressure later on — and more doubts about legitimacy.

The next court hearing in Mr. Anouzla’s case is Tuesday. Morocco ought to drop the charges and focus instead on how to guarantee the rights of journalists and civil society. That would be the right thing to do.