MOSCOW, RUSSIA -- A high-profile Russian journalist who became an adviser to the head of the space agency was detained Tuesday on charges of treason for allegedly divulging state military secrets, the security service said.

Ivan Safronov, 30, worked for business outlets Kommersant and Vedomosti and was one of Russia's most high profile and respected journalists reporting on defence.

His arrest on charges that carry a maximum sentence of 20 years behind bars sparked an uproar among supporters, some of whom took to the streets of Moscow to protest.

Twenty people had been detained, said OVD Info which tracks detentions at political protests.

Safronov's lawyer Ivan Pavlov said it was the first time in nearly 20 years that a reporter had been accused of state treason in Russia, adding the fate of independent journalism was now on the line.

Supporters took to social media arguing that the charges were a response to his reporting, which had ruffled feathers among the ruling elite.

Safronov's arrest came after President Vladimir Putin, who has been in power for two decades, oversaw a controversial nationwide vote that allows him to extend his grip on power until 2036.

On Tuesday, the Federal Security Service said Safronov had collected confidential data about the Russian military, defence, and security and was "handing it over" to the intelligence of a NATO member country.

Moscow's Lefortovsky court was expected to rule on whether to approve Safronov's arrest.

The Kremlin insisted his detention was not related to his previous work as a journalist.

"Our counterintelligence is very busy, has a lot of tasks, and does its job very well," spokesman Dmitry Peskov said.

But the space agency said the charges were unrelated to Safronov's work at Roscosmos where he started working in May.

Roscosmos chief Dmitry Rogozin said Safronov "did not have access to secret information".

In recent years authorities have ramped up efforts to squelch dissent and a wide range of individuals including scientists have been accused of high treason or disclosing state secrets.

Security analyst Andrei Soldatov said Safronov's arrest indicates that repression in the country may be entering a new phase.

"The case against Ivan Safronov is an absolutely new level of repression against journalism in the country," he said.

'ARREST AFTER ARREST'

Safronov reported on the military, politics, and Russia's space programme, which has suffered a series of embarrassing setbacks and corruption scandals in recent years.

In 2019, Kommersant removed from its website an article he co-authored about the delivery of Russian jets to Egypt after court proceedings were opened into the disclosure of state secrets.

He was forced to quit Kommersant in May last year following the publication of an article he co-authored which reported that the speaker of Russia's upper house of parliament was planning to step down.

The entire politics desk of the newspaper resigned in protest against his dismissal.

A number of media outlets including Kommersant on Tuesday issued statements in defence of Safronov, describing him as one of the best Russian journalists and a patriot.

"It is simply impossible to imagine Ivan, the son of an officer, to be a traitor," said Vedomosti.

Safronov followed in the footsteps of his journalist father who also covered defence for Kommersant.

Ivan Safronov senior died in 2007 after falling out of a window under murky circumstances. At the time of his death he worked on a story about Russia sending an air defence system and planes to Iran and Syria.

On Monday, a reporter from the northwestern city of Pskov was fined nearly $7,000 for "justifying terrorism", in a case that sparked an outcry.

Prosecutors had requested that Svetlana Prokopyeva be sentenced to six years in prison for a commentary about a bomb attack and banned from working as a journalist for four years.

"Watching arrest after arrest of Russian journalists –- it's starting to look like a concerted campaign against #MediaFreedom," tweeted Rebecca Ross, a spokeswoman for the U.S. embassy in Moscow.