Mr. Whelan, wearing a sky blue shirt and dark pants, was locked in a glass docket, as is the custom in Russian courts. He did not speak to reporters before they were ushered out of the room. During the hearing he spoke for about 15 minutes in his own defense, the lawyer said.

The judge denied a request for bail and ordered Mr. Whelan held in Moscow’s Lefortovo Prison for another month. If convicted of espionage, he faces up to 20 years in jail.

In prison he has an English-speaking cellmate and has been able to check out English-language books from the library by authors like Jack London, Russian prisoner advocates have said.

David Whelan, his twin brother, who lives in Canada, said in a statement that the family would not comment until it had heard more about the hearing from consular officials.

Mr. Whelan has made numerous trips to Russia over a decade, traveling around the country by railroad and cultivating dozens of friends through Vkontakte, a Russia social media platform akin to Facebook. Many of those friends had military backgrounds, and relatives suggested that he might have been seeking out kindred spirits, given his own long service in the Marines.

He had been given a bad conduct discharge in 2008 related to a larceny case.

From the time Mr. Whelan’s arrest was made public, there has been speculation in Russia that he was imprisoned in order to exchange him for one or more Russians held in American jails. President Vladimir V. Putin has repeatedly expressed outrage at the United States’ detention of Russian citizens.

Mr. Whelan might have been taken, for example, to exchange him for Maria Butina, who pleaded guilty on Dec. 13 in Federal District Court in Washington to a charge of conspiring to act as a foreign agent.