India‘s top court has ordered the release of a freelance journalist arrested for a social media post about Yogi Adityanath, a firebrand Hindu monk who is chief minister of Uttar Pradesh state.

Prashant Kanojia, 26, was arrested on Saturday after he uploaded and commented on a video of a woman claiming to be in love with Adityanath, a leader in Prime Minister Narendra Modi‘s ruling Bharatiya Janata Party (BJP).

Kanojia had been charged with offences under Indian law relating to defamation and publishing obscene material on digital media.

Three other journalists were arrested on similar charges over the weekend, according to local media.

190327111755815

Kanojia’s wife on Monday filed a petition against his arrest before the Supreme Court.

“We order the immediate release of the petitioner from jail,” Justice Indira Banerjee said on Monday in her order, despite a lawyer for the state government arguing that Kanojia’s post was highly inflammatory.

Banerjee also reprimanded the state government for being heavy-handed in its response to Kanojia’s post.

“We can understand that the tweets should not be made. But arresting?” she said.

But the court reportedly said its order should not be seen as approval of Kanojia’s social media posts and that legal proceedings against him would continue according to law.

Kanojia’s detention drew criticism from media groups and opposition parties amid fears the BJP could look to clamp down on the press following Modi’s landslide win last month in the country’s general election.

“Whatever the accuracy of the woman’s claims, to register a case of criminal defamation against the journalists for sharing it on the social media and airing it on a television channel is a brazen misuse of law,” the Editors Guild of India said in a statement.

India is ranked 140th out of 180 countries in the 2019 World Press Freedom Index, which lists police violence against journalists as a striking characteristic of the country’s press environment.