Secretary of State Mike Pompeo on Saturday demanded that Russia free a former US marine accused of spying in Russia after the man underwent urgent surgery in a Moscow hospital.

Fifty-year-old Paul Whelan had emergency hernia surgery late Thursday after suffering "severe abdominal pain," his brother David Whelan said in a statement Friday.

Paul Whelan, who also holds Canadian, Irish and British citizenship, was detained in Moscow in December 2018 for allegedly receiving state secrets.

He insists he was framed while in Moscow for a friend's wedding when he took a USB drive from an acquaintance, thinking it contained holiday photos.

"It is unacceptable that Paul Whelan has been denied necessary medical treatment until his condition became dire," Pompeo said on Twitter.

"We demand Paul's release."

Whelan's case is being heard behind closed doors at a Moscow court, ostensibly due to the case involving state secrets.

The US Embassy has described the secret trial as making a "mockery of justice."

Prosecutors on Monday asked the judge to sentence Whelan to 18 years in a strict regime penal colony. The judge is to deliver a verdict June 15.

Whelan was returned to prison Friday, where the Russian Foreign Ministry insisted he was receiving "all necessary medical assistance."

Whelan's family has complained in the past that he has been mistreated in prison and not received needed care.

Washington has repeatedly denounced his arrest and detention.

The case is one of several sources of US-Russian tension, including differences over the Ukrainian conflict, the war in Syria and the balance of nuclear forces between the two countries.