A Russian lawyer for Paul Whelan, the US citizen accused of spying on Russia, has said his client was carrying state secrets when he was arrested in Moscow but may not have realised it.

Whelan, an ex-marine, has been accused of an unspecified “act of espionage”, which carries a maximum sentence of 20 years in prison.

“I can only confirm that information constituting state secrets was found in the course of Whelan’s detention,” Vladimir Zherebenkov, a court-appointed lawyer, told journalists at a Moscow court on Tuesday. “I do not know how he got it, and what he was supposed to do with it; it is also unknown whether Whelan was aware that he possessed secret information. There is nothing but conjectures so far.”

A judge at the court ruled that Whelan would remain under arrest in Lefortovo prison until at least 28 February as authorities continue their investigation.

Whelan’s court appearance on Tuesday was his first in public since his arrest last month. The pre-trial detention hearing was closed to the press because the case material is secret, but Whelan could be seen by journalists after the judge delivered his sentence. Police escorting Whelan wore balaclavas to obscure their identities.

Since December, anonymously sourced reports in Russian media have said that Whelan received a USB drive with secret information about Russian government employees. But the content of the charges against him have not been made public by officials.

Some western analysts have suggested that Russia arrested Whelan in order to set up an exchange, although Moscow has denied that.

The Russian foreign minister, Sergei Lavrov, said last week that Whelan had been caught “red-handed” when he was arrested by FSB officers at Moscow’s downtown Metropol hotel. Family members have said Whelan was in Moscow for a wedding.

Before Whelan’s court appearance, his lawyer said he could confirm information made public by the foreign ministry. But his remarks confirming Whelan’s alleged possession of a “state secret” appeared to go further.

Because the case is related to national security, Zherebenkov said he was “forbidden from commenting on the case material”, except that which had been made public by the government.

Whelan is the security director for a Michigan-based automotive parts supplier and holds US, Canadian, British and Irish citizenship. He served two tours in Iraq and was given a bad-conduct discharge in 2008.