JERUSALEM — When a young Israeli woman was released from detention in Syria this week, after having been arrested for crossing illegally into Syria, the official story was that she had been the beneficiary of a straightforward prisoner swap. In return for her freedom, the Israeli government announced, she had been exchanged for two Syrian shepherds captured by the Israelis.

But if this deal between two enemy states, which have never shared diplomatic relations, sounded too swift and easy, it was. In secret, Israel had in fact also agreed to a far more contentious ransom: the financing of an undisclosed number of coronavirus vaccines for Syria, according to an official familiar with the content of the negotiations.

Under the deal, Israel will pay Russia, which mediated it, to send Russian-made Sputnik V vaccines to the regime of President Bashar al-Assad of Syria, the official said. Israel has given at least one vaccine shot to nearly half its population of 9.2 million, while Syria — now entering its 11th year of civil war — has yet to begin its vaccine rollout.

The Israeli government declined to comment on the vaccine aspect of the deal, while a Syrian state-controlled news outlet, the Syrian Arab News Agency, denied that vaccines were part of the arrangement. Asked about the vaccines in a television interview on Saturday night, Prime Minister Benjamin Netanyahu of Israel evaded the question, saying only that no Israeli vaccines were being sent to Syria.

“We’ve brought the woman, I’m glad,” Mr. Netanyahu said. He expressed thanks to President Vladimir V. Putin of Russia and said, “I won’t add any more.”

The deal constitutes a rare moment of uneasy cooperation between two states that have fought several wars and still contest the sovereignty of a tract of land, the Golan Heights, that Israel captured from Syria in 1967.

It also highlights how vaccines are increasingly a feature of international diplomacy. And it reflects a vast and growing disparity between wealthy states, like Israel, that have made considerable headway with coronavirus vaccines and may soon return to some kind of normality — and poor ones, like Syria, that have not.

Among Palestinians, news reports about the Israel-Syria deal have increased frustrations about the low numbers of vaccines provided by Israel to Palestinians living in the occupied territories. Israel has supplied only a few thousand vaccines to the approximately 2.8 million Palestinians living the occupied West Bank, and last week the Israeli government briefly delayed the delivery of a first batch of vaccines to Gaza, where nearly two million people live.

Israel maintains that the Oslo Accords absolve it of a responsibility to provide for Palestinian health care. But rights campaigners and Palestinians cite the fourth Geneva convention, which obliges an occupying power to coordinate with the local authorities to maintain public health within an occupied territory.

Israeli officials have said they must vaccinate their own population before turning to the Palestinians. But the Syria deal sends a different message, said Khaled Elgindy, a researcher and former adviser to the Palestinian leadership.

“Israel is willing to provide vaccines to Syrians outside their borders, but at the same time not provide them to an enormous occupied population that they are legally responsible for,” Mr. Elgindy said. “That seems to be sending a message that they are deliberately trying to avoid their legal responsibility to look after the welfare of that occupied population.”

Among Israelis, the prisoner swap has raised concerns about how a civilian was able to cross the highly policed and tense border with Syria undetected by the Israeli authorities.

The woman, 23, crossed into Syria near Mount Hermon on Feb. 2 without initially being spotted by Israeli or Syrian forces, the official said. Her name currently cannot be published, by court order.

Israel learned that she had disappeared only when her friends informed the police that she was missing. She entered Syrian detention only after a Syrian civilian who approached her realized she was Israeli and called the police.

Israel then asked Russia — a Syrian ally with a strong military presence in the country — for help in mediating her release. Russia and Israel have coordinated during similar episodes in the past. In 2016, Russia helped mediate the return of an Israeli tank seized by Syrian forces in 1982 in Lebanon. In 2019, Moscow facilitated the return of the body of an Israeli soldier killed during the same clash, Zachary Baumel.

The woman grew up in an ultra-Orthodox family in a settlement in the West Bank, and she was said to have a history of attempting to illegally enter Israel’s Arab neighbors — once in Jordan, and once in Gaza. Both times, she was apprehended by Israeli forces, returned, questioned and warned not to do so again.

Israeli negotiators sought to act quickly, to avoid a replay of the crisis that followed the disappearance in Gaza of Avera Mengistu, a man with a history of mental illness who marched into the strip in 2014 and has been held ever since by Hamas, the militant group, which frequently raises the price for his release.

Mr. Netanyahu spoke twice directly with Mr. Putin, while the Israeli national security adviser, Meir Ben-Shabbat, communicated with his Russian counterpart, Nikolai Patrushev.

The Syrians first demanded the release of two Syrian residents of the Golan Heights imprisoned in Israel, but that arrangement broke down after it turned out that the two did not wish to return to Syria.

Israel then offered the release of the two shepherds, and at some point in negotiations, the possibility of vaccines was raised.

The Israeli cabinet voted to agree to the terms of the deal on Tuesday, the same day that the 23-year-old was flown to Moscow. Following further negotiations between Israeli and Russian officials, she was returned to Israel on Thursday.

In Moscow, officials had offered no confirmation of such an arrangement by late Saturday, and Russian news media carried only reports citing Israeli publications.

But the Russian government has for months been deftly using its vaccine in diplomacy from Latin America to the Middle East. As recently as Thursday Mr. Putin’s special envoy to Syria, Alexander Lavrentiev, suggested that Russia would be supplying its Sputnik V vaccine to Syria in an interview with the Tass news agency.

Patrick Kingsley reported from Jerusalem, Ronen Bergman from Tel Aviv and Andrew E. Kramer from Moscow. Hwaida Saad contributed reporting from Beirut and Carol Sutherland from Moshav Ben Ami, Israel.