AMMAN, Jordan — At midnight on a brisk February evening, Imad al-Ash heard a knock at his door. He opened it to find what many Jordanians fear most — a force of nearly 40 agents from the country’s shadowy intelligence organization, known here as the mukhabarat.

Falling on the wrong side of the mukhabarat — which performs both international and domestic intelligence — strikes terror into even the most hardened enemies of Jordan.

But Al-Ash was far from the typical religious extremist or criminal that might draw the agency’s attention. A fifth year computer science student at the University of Jordan, he was not an activist and, although a devout Muslim, he steered clear of fundamentalist groups.

Why the mukhabarat had come to raid his family’s upscale home was a mystery to him.

The mukhabarat eventually accused Al-Ash of posting critical remarks about the king’s policies on a jihadi website, something Al-Ash steadfastly denies. Defaming or slandering the royals here is a crime, but without a copy of the post in question, it was his word against a single agent.

Despite having no hard evidence that Al-Ash had written the post, a military tribunal sentenced the student to two years in prison. He’s now appealing to Jordan’s Supreme Court.

While his case has taken place largely in the shadows of Jordan’s legal system, it highlights a growing concern here about the government’s role in censoring the Internet.

Though it is one of the more transparent countries in the Middle East, Jordan has struggled to find a balance between free speech and its antiquated restrictions on the internet as more and more of its citizens go online.

“In the old media, it was easier for the government to control the content, but the internet has now given the ordinary citizen an unprecedented opportunity to be a journalist,” said Yahia Shukkeir, a local journalist and expert on media and internet censorship in Jordan.

Late last month, the government took its biggest step so far toward regulating the internet, endorsing an amended cyber crimes law. The original law stirred up considerable controversy in large part because of an article that would have made it legal to fine residents up to $2,800 if they “intentionally [sent] or [disseminated] data or information via the internet or any information system that [involved] defamation, contempt or slander of any person.”

The vagueness of the article had a number of local commentators worried the article was too broad, which could create a means for the government to further crack down on seemingly private mediums such as instant messenger.

Although the article was eventually removed the final draft, Samir Rifai, Jordan’s prime minister, is known for his distrust of the media and might have been testing the waters to see what level of restrictions he could get away with, said Shukkeir.

Mohammad Qutaishat, a media rights lawyer in Amman, said if the government of Jordan wanted to censor the internet there isn’t much stopping it. The internet, he said, is delivered to the country via two central networks and the mukhabarat could easily use them as control points to determine what content can enter Jordan.

“If you compare Jordan to pretty much all the countries I can think of in the region, I think we have the best freedoms online,” said Ammar Ibrahim, chief technical officer of Al Bawaba, an online news site headquartered in Amman.

He said stories of arrests and other harassment by authorities are mostly isolated incidents, not a general trend. The government does not appear to want to regulate the internet, he said, only place restrictions on what is posted online.

Cases like Al-Ash’s, he said, have more to do with the individual than they do with overall internet freedoms.

With no concrete evidence, it’s unlikely that the Supreme Court will even hear the case, said Saleh Armouti, Al-Ash’s lawyer. They’re more likely to order his immediate release. Even in cases with hard evidence, it’s unusual that such defamation would result in any extreme penalties.

“A lot of cases like this are dropped. There are many people who go to the mukhabarat to accuse people they hate of saying bad things about the King. Most of these cases are fake so most people are released,” Armouti said.

Al-Ash’s treatment has led many familiar with the case to speculate that the government may be trying to make an example of him, a cautionary tale to other internet users who think they can get away with anonymous postings.