“There have been a lot of conversations of senior administration officials with their Thai counterparts about this,” said one American official, who spoke on condition of anonymity after staying up until 2 a.m. awaiting the news from Bangkok. American officials had feared that Russian pressure would prevail and Mr. Bout might be flying home.

“This really was a welcome surprise,” the official said of the court’s decision.

Russia, which had been seeking to prevent Mr. Bout from being placed in the American legal system, reacted angrily.

“We regret what, in my view, is an illegal political decision taken by the appellate court in Thailand,” Sergey V. Lavrov, Russia’s foreign minister, said Friday, according to the Interfax news agency. “Based on the information we have at our disposal, the decision was made under very strong outside pressure. This is lamentable.”

He vowed to do everything necessary to ensure Mr. Bout’s return to Russia.

The decision culminated a decade-long effort by the United States to bring Mr. Bout, 43, to trial. “The Clinton folks started it, the Bush administration continued it and Obama finished it,” said Douglas Farah, the co-author of a book about Mr. Bout, “Merchant of Death,” and a fellow at the International Assessment and Strategy Center in Washington.

Mr. Farah said the United States began pursuing Mr. Bout in the 1990s after officials became alarmed that he was making conflicts more deadly by showering warring parties with weapons on an unprecedented scale, including weapons as sophisticated as attack helicopters.