A Moscow court denied an appeal on Thursday by Evan Gershkovich, a Wall Street Journal reporter who asked to end his pretrial detention in Russia, where he was jailed and charged with espionage 12 weeks ago.

Mr. Gershkovich, an American journalist who has been based in Russia for nearly six years, was arrested in late March and charged with spying, which he denies. Last month, his detention was extended until Aug. 30. Although Russian prosecutors have presented no evidence, he has been held for 12 weeks in Moscow’s high-security Lefortovo Prison, which is run by the K.G.B.’s successor and is known for harsh conditions that include extreme isolation.

The court denied his lawyers’ request. The American ambassador to Russia, Lynne Tracey, was present, as were Mr. Gershkovich’s parents, Ella Millman and Mikhail Gershkovich.

The United States government and The Journal have vehemently rejected the charges. The White House has said that Mr. Gershkovich is “wrongfully detained,” tantamount to being a political prisoner. The designation changes Washington’s approach to the detention of an American abroad, usually because it believes the prisoner was detained on arbitrary grounds or is not facing legitimate charges or a fair judicial process.

On Thursday, Russia said it had received and was considering a request from the United States for a consular visit to the reporter, the Interfax news agency reported. “There is no decision yet, but it is under consideration,” the agency quoted Deputy Foreign Minister Sergei A. Ryabkov as saying. Although Russia granted such a visit in April, it has denied other requests for them.

Press freedom in Russia has sharply declined under President Vladimir V. Putin as he has embraced authoritarian measures targeting journalists, and opposition and dissent. Mr. Putin had focused on local journalists, especially since the start of the full-scale invasion of Ukraine last year, allowing foreign correspondents to work with some sense of freedom.

But that changed on March 29, when Mr. Gershkovich was arrested while on a reporting trip in the central Russian city of Yekaterinburg, becoming the first Western journalist charged with espionage since the Cold War. If convicted, he could face 20 years in a Russian penal colony.

The House of Representatives unanimously passed a resolution on June 13 calling on the Russian government to release Mr. Gershkovich and Paul Whelan, a former United States Marine who is serving a 16-year sentence after a spying conviction in 2020.

Dmitri A. Muratov, the Russian journalist who was awarded the Nobel Peace Prize in 2021, praised Mr. Gershkovich’s work during a media forum in Bonn, Germany, on Tuesday.

“I know him well — practically all of Moscow knows him well,” Mr. Muratov said in an address to the Deutsche Welle Global Media Forum. “He loves the country where he works. He is an incredible journalist, and he is in no way a spy.”