MOSCOW — The arrest of a prominent investigative journalist on drugs charges triggered protests across Russia and abroad in what is being described as a watershed moment for the country’s beleaguered independent media.

Ivan Golunov, a reporter for Meduza, an opposition-friendly news site, was on his way to meet an unnamed source on Thursday afternoon when he was detained by police in central Moscow. Golunov, 36, is the author of a number of hard-hitting reports on alleged corruption by Russian officials and government-linked businesspeople.

Officers said they found over 3 grams of mephedrone — a synthetic stimulant popular among clubbers that is also known as “bath salts” — in Golunov’s backpack. Police then searched the journalist’s apartment and said they discovered 5.37 grams of cocaine, as well as a drugmaking laboratory.

Golunov faces up to 20 years behind bars. He denies the accusations and says he was set up by police, who refused to allow him to speak to a lawyer until the day after his arrest.

“We are absolutely certain that [Golunov’s] arrest is connected to his work,” Ivan Kolpakov, Meduza’s editor-in-chief, told POLITICO. “He had been receiving threats over material that he has been working on.”

“This is a threat for all journalists in Russia” — Ivan Kolpakov, editor-in-chief of opposition-friendly news site Meduza

Kolpakov said that Golunov’s most recent investigation concerned highly placed officials and figures with links to Russia’s powerful state security services. He declined to reveal details of the as-yet-unpublished article, which Golunov filed just hours before his arrest, but said: “It’s likely that the decision [to arrest Golunov] was taken by people within the security services.”

Friends and colleagues said the journalist is a clean-living teetotaler and described allegations of involvement with drugs as absurd. “His only drug is curiosity,” wrote Leonid Bershidsky, a former colleague, on Twitter. “But in Russia that’s against the law.”

Dmitry Dzhulai, Golunov’s lawyer, said his client had told him that police assaulted him twice after his arrest, including when he refused to sign a police report without legal advice. Doctors who visited Golunov in custody said he had suspected broken ribs, a concussion, and severe bruising of the scalp, as well as other injuries. However, medics at a Moscow clinic said Golunov did not require hospitalization, a decision that Kolpakov said was likely taken after pressure from investigators. Police deny the allegations of violence.

“I never thought I’d be present at my own funeral,” a tearful Golunov said when he appeared in court late Saturday evening. A judge placed the journalist, who was kept in a metal cage throughout the court hearing, under house arrest for two months. Hundreds of protesters chanting “Freedom!” gathered in support of Golunov outside the courthouse.

Prosecutors had asked the court to keep Golunov in custody, and the judge’s decision to deny that request was unexpected. Kolpakov said he believed the ruling was influenced by the massive show of support for the Meduza reporter.

“This is a threat for all journalists in Russia,” said Kolpakov. “If the police can allow themselves to falsify a case against a well-known journalist in such a crude manner, then what can those journalists who are less well-known expect?”

Meduza is based in Riga, Latvia, but is staffed by Russian journalists and editors. It was launched in 2014 by journalists from Lenta.ru, a Moscow-based website that came under Kremlin pressure over reports critical of President Vladimir Putin. Reporters Without Borders, the Paris-based media watchdog, recently rated Russia 149th out of 180 countries for media freedom.

Russia’s interior ministry, which oversees the work of the police, on Friday published photographs purporting to show the drug laboratory in Golunov’s apartment. However, the ministry later removed all but one of the images from its website after admitting that the apartment in question was not Golunov’s.

The arrest triggered an unprecedented display of solidarity among Russia’s journalists, with even state media employees speaking out against what they called a blatant attempt to silence one of the country’s top investigative reporters.

As of Sunday morning, 39 employees of the three main state media outlets — Rossiya Segodnya, RIA Novosti and Tass — had signed an open letter by the Russian Union of Journalists calling for Golunov’s release. Russian musicians and other celebrities also spoke in his defense.

MediaZona, another Russian news website that is often critical of the authorities, said in a statement that Golunov’s arrest is a blatant attempt to intimidate investigative journalists: “We must defend Ivan for the sake of the future of independent journalism, without which there is also no future for the entire country.”

Police made a number of arrests on Friday as around 500 protesters gathered outside the interior ministry headquarters in Moscow. At one point, riot police attempted to clear the crowd with a device that emitted a high-pitched sound, but protesters responded with mocking laughter.

There have also been protests in support of Golunov in dozens of other Russian towns and cities, from Vladivostok to St. Petersburg. Protests of varying sizes also took place outside Russian embassies in Berlin, Kiev, London, Riga and Washington.

“We are concerned about reports of a violent arrest of investigative journalist Ivan Golunov in Moscow,” Daniel Holtgen, a spokesman for the Council of Europe, wrote on Twitter. A similar tweet in support of Golunov by the U.S. embassy in Moscow triggered an angry rebuke from the Russian foreign ministry, which replied: “We don’t really understand what you have to do with Golunov.”

The controversial drug charges against Golunov overshadowed the annual St. Petersburg International Economic Forum, which took place June 6-8 and was attended by Putin. Although the president did not comment on the case, Anton Kobyakov, one of his advisers, criticized the decision by police to publish false photographic evidence, saying that “deception and manipulation of facts are covered by articles in the criminal code. Those responsible will be made to answer.”

Kobyakov’s comments, combined with the court’s surprise decision to place Golunov under house arrest, rather than lock him up until his trial, led to speculation that the authorities had been taken unawares by the strength of the reaction to the journalist’s arrest. However, fewer than 0.5 percent of Russian criminal cases end in an acquittal, and it would be almost unprecedented for a court to find a suspect innocent of such serious drug charges.

“The system just doesn't have a reverse gear,” Alexei Kovalev, head of investigations at Meduza, wrote in an online post. “Now that Ivan is in custody and charged with a serious crime, no matter how laughably flimsy the evidence, you can't just throw it away without these people admitting a wrong and losing face/careers.”