Just before the launch of a major protest march in the northern Moroccan city of Al Hoceima this July, state security forces arrested prominent journalist and government critic Hamid al-Mahdaoui. His supposed crime: “inciting” people to participate in an “outlawed demonstration.”

Later that day, police in Al Hoceima deployed tear gas and blockades to break up a peaceful rally, arresting dozens of activists and injuring more in the process. It sent a clear message to sympathizers of so-called Al Hirak, a social movement based largely in the country’s Rif region, that public dissent will not be tolerated. Al Hirak was sparked after a fishmonger was crushed to death inside a trash compactor while trying to recover fish confiscated by police last October. Protesters have broadly condemned state corruption and called for development in infrastructure and public services.

The government’s response to Mahdaoui, editor in chief of independent news site Badil.info, was harsh and swift. The week following his arrest, a local court sentenced him to three months in prison. Then in September, following an appeal, his sentence was increased to one year. In the meantime, without Mahdaoui’s leadership, Badil.info has been shuttered, and the journalist is facing a second trial—this time, for allegedly damaging “state security.” The crime carries a maximum sentence of five years.

For journalists and human-rights observers in Morocco, Mahdaoui’s trials are just a small part of the state’s growing crackdown on free speech. In a country that maintains strong ties to Western powers and is often applauded for its relative liberalism, those that dare question the government line face a mounting set of legal and economic hurdles. Since the outbreak of the movement in Rif, observers say the repression has only increased: As it stands, seven other journalists are in prison today, including four citizen journalists and three media assistants, all of them detained after documenting ongoing protests.

Omar Radi, an independent journalist based in Casablanca, said the hostility flows from a basic fact about the monarchy, which, in contrast to its liberal image abroad, ranks 133rd out of 180 in the most recent press rankings from Reporters Without Borders, behind countries like Zimbabwe and Myanmar. “It’s not a state that follows the rule of law; it’s a police state,” Radi said. “And journalism quite simply sheds light on this gap, on the declarations of authorities and their own realities. And it’s a pretty unpleasant gap, a pretty immense gap. So yes, independent journalism represents a danger to power.”

Radi played a leading role in the so-called February 20 movement, Morocco’s contribution to the Arab Spring of 2011. Protests back then were larger in size and geographic scope than current ones in the Rif. But, not unlike today’s demonstrators, the movement in 2011 condemned state autocracy and corruption in favor of political freedom and economic justice. In a media landscape saturated by regime stenographers and apologists, independent journalists and citizen journalists played a crucial role in getting the word out. “For sure, if there was no electronic press, I don’t think there would have been a movement,” said Maati Monjib, a left-wing historian and writer based in Rabat who has faced harassment for his criticism of the monarchy. “Ninety-five percent of the written press, which is more or less controlled by the regime, and every TV and radio station discouraged [the movement] before even the first protest date.”

According to Monjib, press hostility toward the February 20 movement even extended to well-regarded newspapers like Al Massae. On the other hand, upstart online outlets like Lakome—launched in December 2010—regularly published chronicles from the front lines of the demonstrations, attracting readers despite limited budgets and staff.

Eventually, the monarchy recognized the political threat posed by the movement. In an attempt to minimize the risk of ending up like his Tunisian and Egyptian counterparts, Morocco’s King Mohammed VI—who took over from his father, Hassan II, in 1999—called for a constitutional referendum in summer 2011. Approved by an overwhelming majority of electors, the reforms require the king to appoint a prime minister from the party that wins the most seats in parliamentary elections, making the legislature slightly less likely to rubber-stamp legislation than before.

Parliament, in turn, has since enacted some modest liberal reforms, a few of which extend to free speech. Last August, legislators amended the nation’s press code and eliminated prison time as punishment for speech offenses. (Before the changes, for example, journalists in Morocco could be sentenced to jail for “insulting” foreign heads of state and diplomats.)

Nevertheless, human-rights observers and free-press advocates say the reforms mask the monarchy’s crackdown on speech it doesn’t like. As Issam Benkarroum, a human-rights specialist at the Rabat chapter of the Moroccan Association for Human Rights (AMDH), explains, the new press law does not mark the end of the kingdom’s harassment and repression of journalists. It simply shifts its legal basis from the press code toward the penal code.

“Going after people for having expressed an opinion, that’s not seen well by the international community,” Benkarroum said. “That’s direct repression of free speech and of the freedom to protest. So [the government] tries to incriminate them under the penal code, with things that have nothing to do with the exercise of their rights. That way, they can say afterwards, ‘It’s just a simple crime. It’s not because of activism that I’m pursuing them.’”

Such logic is at the heart of the state’s multiyear, high-profile pursuit of seven journalists, including Monjib and Rachid Tarik, president of the Moroccan Association of Investigative Journalism. Five of them, including the former, stand accused of “threatening national security” and two of them, including the latter, are accused of “failing to report foreign funding” in a joint trial that has dragged on since November 2015. The charges came after the journalists held a training on Storymaker, an app that allows users to anonymously upload edited audio and video packages online.

The accused, some of whom face up to five years in prison, say the government’s allegations are outlandish and driven by ulterior motives. (Monjib is particularly disliked by regime loyalists for brokering discussions between moderate Islamists and secular leftist parties.) And they’ve been echoed by NGOs including Human Rights Watch, Reporters Without Borders, Electronic Frontier Foundation, and the Committee to Protect Journalists.

“These are clearly political accusations,” Tarik said. “It’s a trial that’s been set up to keep critical voices quiet.”

Monjib said the government’s motivations stem from its anti-democratic nature. “For all authoritarian regimes, the truth is corrosive,” he explained. “Why are they so afraid of Storymaker? They’re afraid because with a smartphone, for example, you can film an act of corruption, and you can send it very quickly in a secure way. And so they’re afraid of the truth getting out. Even if that truth is relative, they don’t want it out.”

From poorly paid bloggers to the most comfortable of establishment writers, nearly all journalists in Morocco are familiar with the existence of certain “red lines”—topics that one should “avoid challenging,” as Tarik put it. At the moment, he said, that list includes Islam, the monarchy, and Morocco’s control of Western Sahara, a disputed territory in which the kingdom has long been accused of human-rights abuses. As a result, Tarik said journalists regularly engage in self-censorship, operating in a “perpetual state of dread.”

Meanwhile, though the number of online news sites has grown exponentially since 2011, their quality is far from guaranteed. Many are mouthpieces for the regime and others tend to publish inaccurate information, according to Tarik. Quality investigative journalism is hard to find.

Going too far lands writers in trouble. Before Mahdaoui’s imprisonment and before the charges against Monjib and company, the state targeted another high-profile journalist, Ali Anouzla.

In August 2013, the founder and editor-in-chief of Lakome—an independent news site that blossomed with its coverage of the February 20 movement—published a bombshell article: King Mohammed VI, Anouzla reported, had pardoned a Spanish serial child rapist serving a 30-year sentence, in a gesture of goodwill toward Spanish King Juan Carlos, a scoop that triggered protests in Rabat. The following month, the government responded, hitting the reporter with charges of “providing material assistance to terrorist acts” after his site linked to a video hosted by the Spanish daily El País in which Al Qaeda’s North African branch criticized the Moroccan monarchy. Shortly thereafter, the imprisoned journalist decided to shut down Lakome. Though no longer detained, Anouzla still faces up to 20 years in prison.

“The [government] was taking revenge against a number of articles we’d written, on long vacations taken by the king, on the dangers of Saudi Arabia to the region and our country, and so on and so on,” said Radi, who used to work with Anouzla at Lakome. “Morocco doesn’t want this sort of model of journalism to flourish, because it knows that it brings risks and dangers.”

Other than prison time and legal headaches, writers and critics who cross the kingdom’s red lines run the risk of attracting vicious personal attacks. Monjib, for example, said he has encountered “hundreds” of defamatory stories about himself since 2013. They have alleged, at different times, that he is both a Zionist and a Holocaust denier. Another displayed a doctored photo of Monjib saluting Ban Ki-moon, both of them dressed in military garb, published shortly after the United Nations Secretary General criticized Morocco’s occupation of Western Sahara in 2016.

Monjib said the same tactic applies to activists, too. “Even for the leaders of the Rif movement, from the very beginning, they started with defamation,” the historian maintained, recalling photos released of a protest leader with prostitutes. “It might make us laugh, but it doesn’t make the people laugh. There’s a part of the population that believes this.”

Finally, for less established journalists, the profession’s barriers to entry appear set to increase. As part of recent press reforms, all news sites will be required to be registered by someone with the official professional status of journalist. The latter, in turn, is handed out exclusively by the state and reserved to those with an undergraduate degree—leaving citizen journalists and others on the margins. Radi, for one, said he has never received a press card. He was hoping to launch a news site, but said plans are stalled since it hasn’t received authorization under the new law.

If ever there was a sign of journalism’s revolutionary potential in Morocco today, it is perhaps the recent arrests of citizen journalists in Al Hoceima. “They played an important role in the Rif, and the proof is seven of them are in prison today,” said Monjib.

In doing so, the group joined dozens of other activists and movement leader Nasser Zefzafi. The latter was detained in May for undermining “state security,” and—in spite of a petition from international parliamentarians, activists, and writers—remains in prison.

Still, if the movement has struggled to both articulate a more general political platform and to gain traction outside the country’s north, observers like Benkarroum say popular protests, which are fueled by journalists reporting injustice and inequality, are still the best hope for a more democratic future. On the other hand, he is not anticipating the West to levy much pressure.

“We know that economic and [geostrategic] interests take precedence over human rights for these countries, notably France, the United States, and Great Britain, and their interests are with the Moroccan regime, not the population and its aspirations for democracy and human rights,” he said. “The solution is interior to Morocco, that is to say, we’re not expecting much from abroad. We know that it’s through struggle and a popular movement that we’ll be able to install democracy in Morocco.”