The lawyer for Paul Whelan, the American man being held in Moscow on suspicion of spying, said his client was given documents that contained Russian “state secrets” before he was arrested but he did not know he had them.

Whelan, 48, of Novi, Michigan, a former U.S. Marine, was arrested in Moscow last month on suspicion of espionage. He was born in Canada to British parents before the family moved to the U.S. He holds British, Canadian and Irish passports.

Whelan made his first public appearance in court Tuesday to hear the appeal of his arrest. The judge upheld the previous ruling that ordered him to be kept behind bars at least until the end of February. The former Marine was kept in a glass cage and did not speak to reporters.

RUSSIA CLAIMS AMERICAN PAUL WHELAN WAS CAUGHT SPYING 'RED-HANDED'

His lawyer, Vladimir Zherebenkov, told Russian news agencies Tuesday that when his client was detained at a Moscow hotel at the end of December he had something with him that contained “state secrets.”

Whelan reportedly asked an unnamed person to email him information about his travel to Russia but could not download It and asked the person to put it on a flash drive.

"He was expecting to see on the flash drive some personal information like pictures or videos, something like that, about that person's previous trips around Russia," Zherebenkov said. "We don't know how the materials that contain state secrets ended up there."

However, Whelan was detained before he could look at the documents, the lawyer said.

PAUL WHELAN, US MAN ACCUSED OF SPYING IN RUSSIA, CHARGED WITH ESPIONAGE: REPORT

Zherebenkov also said it was not immediately clear what has happened to the person who reportedly gave the flash drive to Whelan.

Paul Whelan previously worked for Kelly Services, which maintains offices in Russia. He received a “bad conduct” discharge from the Marines, according to his official military personnel file obtained by Fox News. His dates of service were listed as starting from May 10, 1994 to Dec. 2, 2009. His brother, David Whelan, said he fought in Iraq on multiple tours of duty.

CLICK HERE FOR THE FOX NEWS APP

The Associated Press contributed to this report.