MOSCOW — Declaring himself the victim of “an absurd political kidnapping,” an American detained in Russia since December on espionage charges used a brief court appearance on Thursday to appeal to President Trump to “keep American great” by taking robust action to get him released.

“Mr. President, we cannot keep America great unless we aggressively protect and defend American citizens wherever they are in the world,” the man, Paul N. Whelan, shouted to reporters from inside a glass cage at the Moscow City Court.

He denounced the opaque legal process that has ensnared him as “the Moscow goat rodeo.”

Mr. Whelan, 49, a Trump supporter who is a citizen of the United States, Britain, Canada and Ireland, has repeatedly denied being a spy and again declared his innocence in court on Thursday. He had asked to be released from pretrial detention in a grim Moscow prison and placed under house arrest instead; the judge rejected the request.

“I am asking the leaders and governments in Ottawa, Dublin, London and Washington for their help and public statements of support,” said Mr. Whelan, who works in corporate security, reading from a handwritten statement as consular officials from the United States and Ireland looked on.