Most of the flight’s passengers were citizens of the Netherlands, which is leading an international investigation into what it views as a murder case. Dutch officials confirmed that Mr. Tsemakh was part of the exchange, saying that they deeply regretted his inclusion “under pressure from the Russian Federation.”

Investigators believe that Mr. Tsemakh could have provided the first insider’s account of who exactly shot down the passenger jet and under whose orders.

Mr. Tsemakh is unlikely to speak now that he is back in Russia, which has repeatedly denied any involvement in the plane’s downing despite strong evidence that it was at least partly responsible.

International investigators have concluded that Flight 17 was shot down with a Russian antiaircraft system that was sent into eastern Ukraine by Russia’s military. Dutch prosecutors in June charged three Russians and a Ukrainian — three of whom were said to have ties to Russian military intelligence — with the murder of the passengers and crew.

Russia’s refusal to cooperate with the investigation into the Flight 17 tragedy, its occupation of Crimea and its continued support for Russian-speaking rebels in the eastern Ukrainian regions of Donetsk and Luhansk have stymied a long diplomatic campaign by Moscow to get Western sanctions lifted.

With the prisoner swap, however, Mr. Putin seems eager to show himself as less recalcitrant in the hope of denting Western resolve. The sanctions were imposed in 2014 by the United States and the European Union to pressure Moscow to curtail its military meddling in Ukraine.

Vladimir Fesenko, a researcher with the Penta Center, a research group in Kiev, said that the Russian leader wanted to show at least a measure of flexibility in what he described “as a new stage in Putin’s big gamble with the West.”