MOSCOW (AP) — A Moscow court on Thursday ruled that Wall Street Journal reporter Evan Gershkovich must remain in jail on espionage charges until at least late August, rejecting the American journalist’s appeal to be released.

The 31-year-old U.S. citizen was arrested in late March while on a reporting trip. A Moscow court ruled last month to keep him in custody until Aug. 30, but his lawyers had challenged the decision.

Gershkovich, wearing a black T-shirt and light blue jeans, looked tense and paced inside a glass defendant’s cage while waiting for the hearing to begin at the Moscow City Court. Then other journalists in the courtroom were asked to leave and the proceedings took place behind closed doors.

The ruling was broadcast to reporters, who watched it on two large TV screens in a separate room in the courthouse.

While waiting for the judge, Gershkovich smiled and chatted with his parents, who were present. U.S. Ambassador Lynne Tracy also attended.

“Evan continued to show remarkable strength and resiliency in these very difficult circumstances,” she told reporters afterward.

Tracy said she was “extremely disappointed” by the ruling, reiterating that Gershkovich was “an innocent journalist” and Russia’s charges against him were baseless.

“Such hostage diplomacy is unacceptable, and we call on the Russian Federation to release him,” she said.

The Wall Street Journal said in a statement after the hearing that Gershkovich “has been wrongfully detained for more than 12 weeks for nothing more than doing his job as a journalist,” and it again called for his immediate release.

Gershkovich and his employer have denied the allegations, and the U.S. government has declared him to be wrongfully detained.

His arrest in the city of Yekaterinburg rattled journalists in Russia, where authorities have not detailed what, if any, evidence they have to support the espionage charges.

Gershkovich is being held at Moscow’s Lefortovo prison, which is notorious for its harsh conditions. Tracy said the U.S. Embassy was denied consular access to Gershkovich on three occasions since she last visited him in jail in April.

Russian Deputy Foreign Minister Sergei Ryabkov told reporters the ministry is considering another visit request from the embassy.

Analysts have pointed out that Moscow may be using jailed Americans as bargaining chips in soaring U.S.-Russian tensions over the Kremlin’s military operation in Ukraine. At least two U.S. citizens arrested in Russia in recent years — including WNBA star Brittney Griner — have been exchanged for Russians jailed in the U.S.

Ryabkov has cautioned, however, that the possibility of a swap in Gershkovich’s case “could only be considered after a court delivers its verdict.” Prominent lawyers who worked on espionage cases told The Associated Press that the investigation alone could take up to 18 months.

Gershkovich is the first American reporter to be arrested on espionage charges in Russia since September 1986, when Nicholas Daniloff, a Moscow correspondent for U.S. News and World Report, was arrested by the KGB. Daniloff was released without charge 20 days later in a swap for an employee of the Soviet Union’s U.N. mission who was arrested by the FBI, also on spying charges.

This article first appeared on APnews.com