MOSCOW — A Moscow court on Friday extended by three months the custody of Paul Whelan, an American citizen charged with espionage, meaning he will stay behind bars through late May.

Looking distressed and pale, Whelan listened from a glass enclosure as the judge approved the request from Russia’s security services, who detained the 48-year-old former Marine in late December.

Whelan was seized by members of the FSB, the successor to the Soviet-era KGB, at his Moscow hotel room during what his family described as a personal trip to see friends. Since his arrest two months ago, Whelan has been held in a high-security prison on Moscow’s outskirts.

According to his lawyer, Vladi­mir Zherebenkov, Whelan was handed a flash drive containing a “state secret,” but no other official details have emerged in a case that has been dogged by murkiness and delays in standard procedure.

Speaking in court where his reticent and bespectacled American client sat dressed in a blue sweater and navy jacket, Zherebenkov said Whelan maintains his innocence, insisting that he received the alleged state secret unwittingly on a drive that he thought contained photos and videos of one of his previous trips.

A statement from Whelan’s family denounced the FSB for “attempts to concoct evidence.”

“We will continue to work to make sure Paul is not mistreated while in jail and work for his release from this wrongful detention,” the statement said.

A psychological evaluation of Whelan has concluded that he is of sound mental health, meaning he would have been fully aware of his actions, the Interfax news agency quoted defense lawyer Olga Karlova as saying. 

Zherebenkov told The Washington Post after the hearing that Whelan’s detention was extended because prosecutors have been slow to collect evidence for their case. Among other things, they “need to interrogate 10 more witnesses and carry out phonetic-acoustic research,” he said.

He said the evidence presented against Whelan so far is “totally insufficient” to prove espionage and that investigators are scrambling to find evidence to back up their claims.

“The situation is rather interesting,” Zherebenkov said. “First, Mr. Whelan was indicted, and now the grounds for the accusation are being proved.”

The lawyer said Whelan went on a trip with a Russian man, visiting a monastery and a sauna and cooking shish kebabs. “Naturally, he asked for some photos to remember it,” Zherebenkov said. “It’s not his fault that there was extra data on the flash card other than photos of their trip. There is no evidence that he demanded that data, offered money or anything.”

The extension of Whelan’s custody comes just days after another American, prominent investor Michael Calvey, was detained and later charged with fraud in a Moscow court, raising fears over Russia’s ability to attract foreign capital. 

Neither Whelan nor Calvey was given consular access to U.S. Embassy officials within four days after their detention, a requirement under a bilateral agreement with the United States.

Their arrests come at a time of heightened tensions between Washington and Moscow, as the two nations continue to spar over disputes including the conflict in Syria and Russian meddling in the 2016 U.S. election. The arrests also raise questions about Washington’s ability to protect its citizens abroad. President Trump has yet to make public mention of either case.

Whelan’s family, in an emailed statement to news media this week, said that Whelan had signed and sent a Privacy Act Waiver — allowing consular officials to release information about his case and potentially launch an advocacy campaign — to the U.S. Embassy in Moscow but that it did not arrive.

The U.S. Embassy in Moscow said Friday that it was “strongly concerned” by the delay.

“In every other instance, we have been able to obtain a signed PAW, but in Mr. Whelan’s case, the Investigative Committee is not allowing this to happen,” embassy spokeswoman Andrea Kalan wrote in a tweet. “Why is this case any different?”

In explaining the delay in delivering the waiver, Zherebenkov, Whelan’s lawyer, told The Post that such documents must pass through the detective overseeing the investigation and the detention center’s administration and thus “may take a long time” to reach the embassy. Also, the waiver “needs to be translated first,” he said.

“What really bothers me is that [Whelan’s] right to defense is being restricted,” Zherebenkov said. Although a lawyer has the right to meet a client without limits on the number or duration of visits under Russian law, he said, “we have not been given opportunity to meet sufficiently.” He said this was ostensibly because of “a shortage” of meeting space where Whelan is being held, a problem he views as “artificial.” The defense attorney even offered to have Whelan stay at his Moscow apartment under house arrest but was turned down, he said.

Referring to Calvey, the U.S. Embassy said Thursday: “We have expressed our strong concern about this delay through diplomatic channels . . . We insist on access now.” 

When Whelan was finally granted U.S. consular access — after six days in a detention center — Moscow gave no reason for the delay.

A citizen of four countries — Ireland, Canada and Britain, in addition to the United States — Whelan has received consular visits from representatives of all four, although some of those visits, notably one from the British, came after considerable time. 

If found guilty of espionage, Whelan could face up to 20 years in a Russian prison. 

Matthew Bodner contributed to this report.