The U.N. Security Council on Friday unanimously agreed to a last-minute compromise that will allow humanitarian aid to continue flowing into Syria across the Turkish border for the next 12 months. The vote came just one day before a cutoff of food and medical assistance to millions of Syrians living in harsh conditions.

Both the United States and Russia, which had long threatened to veto any aid resolution, hailed the vote as a “historic” success and a direct result of what Russia’s U.N. ambassador called “the spirit” of last month’s summit in Geneva between President Biden and Russian President Vladimir Putin.

“It was possible above all because the United States and Russia were able to come together,” said Linda Thomas-Greenfield, the U.S. ambassador to the United Nations. She called it “an important moment in our relationship” that could provide a template for the future.

An early foreign policy test for Biden, the vote may prove only a fleeting example of newfound cooperation, as Washington and Moscow face much bigger pending issues, including in cybersecurity and nonproliferation.

In a call between Biden and Putin on Friday, the two leaders “commended the joint work of their respective teams” that led to the U.N. vote, according to a White House readout. But Biden also raised the issue of “ransomware attacks by criminals based in Russia” and said “the United States will take any necessary action to defend its people and its critical infrastructure in the face of this continuing challenge,” according to the readout.

The administration had staked a significant amount of political capital on the humanitarian-aid resolution. Biden raised it directly with Putin in Geneva, and senior administration officials had repeatedly made public statements stressing the importance of continuing the flow of assistance.

The mutual congratulations masked a tense week of negotiations over the resolution sponsored by Norway and Ireland. Russia refused to discuss the matter with the Security Council, and conducted only private talks with the United States.

Last year, Russian and Chinese vetoes had reduced the number of crossings for U.N.-coordinated aid going to an estimated 14 million displaced and suffering Syrians from four to one, at Bab al-Hawa into northwest Syria. That mandate is due to expire Saturday, at which point all assistance, totaling at least 1,000 truckloads per month into Syria’s Idlib province, would have stopped.

The United States had originally asked for Bab al-Hawa to remain open for at least 12 months and for two others to be reopened, while Russian officials continued to insist that the cross-border shipments, which it charged were supporting terrorist groups in Idlib, were a violation of Syrian sovereignty.

Russia has been the primary military and political ally of Syrian President Bashar al-Assad during the decade-long Syrian war. It demanded that all aid be delivered through Damascus and distributed by the Assad government across existing conflict lines.

The 15-to-0 vote, on a U.S.-Russia compromise worked out late Thursday and into Friday morning, approved a six-month extension for Bab al-Hawa only, with an additional six months automatically added — without further vote — after U.N. Secretary General António Guterres issues a report focusing on the “transparency” of distribution and efforts to increase the amount of “cross-line” aid.

“We will carefully monitor the next six months,” Russian Ambassador Vasily Nebenzya said, and “expect to have detailed information . . . particularly on the mechanics of U.N. distribution on the ground, the locations and the stores of humanitarian deliveries.”

In a statement after the vote, Thomas-Greenfield said unequivocally that “we got 12 months of a lifeline to the Syrian people. Certainly, we would have wanted to have three border crossings,” adding that “we certainly didn’t want less” than the existing single crossing.

“This is a success,” she said. “No vote will be required, and the council will work with the secretary general’s office to ensure that once he puts the report on the table it will be accepted by all council members.”

The vote ensured that aid would continue to reach millions of Syrians but “has fallen short of what is needed to meet record levels of need,” David Miliband, president and CEO of the International Rescue Committee, said in a statement that echoed views of humanitarian organizations that it was the bare minimum to avoid failure.

France, the current Security Council chair, voiced mixed feelings. While France was “relieved,” French Ambassador Nicolas de Rivière said, “let us be clear. . . . The mechanism we just renewed will be inadequate.”

Charging the government with using aid for “political ends,” he said that “our position and that of our European partners remains. . . . We will not finance reconstruction and we will not lift sanctions” on the Assad regime, “as long as a credible political process is not launched. . . . Neither will we finance development activities that contribute to the Syrian regime.”

De Rivière also reflected the concern of many members that Russia’s insistence on more “transparency” in how and where aid is distributed is a ploy to seek out its perceived enemies among displaced Syrians and aid workers in Idlib.

The vote staved off what relief workers said was an accelerating crisis in Idlib, a province reeling from overlapping calamities, including the aftershocks of a Syrian government military offensive last year that displaced nearly a million people — many of whom ended up in the province after being routed by earlier battles elsewhere.

Most have remained in makeshift or formal refugee camps, with little access to basic services and too poor to buy food and other commodities.

Seventy-five percent of the population relies on humanitarian aid, according to the United Nations.

“The U.N. is the only agency that can fill the gap,” said Mohamed Al-Maraei, the deputy project manager for Ataa, a Turkey-based nongovernmental organization that distributes relief supplies in a massive refugee camp in Idlib along the Turkish border. Without it, he added, the province would “collapse.”

He spoke in an interview Thursday, the day before the Security Council vote, as his organization distributed food — chickpeas, lentils, rice, sugar, salt and sunflower oil — in a narrow alleyway of the camp, called Atmeh. It would help sustain families for a month, until the next deliveries arrive.

The organization was distributing to 177 families at this stop, the last of several that day, in what appeared to be a well-oiled operation. Tents were set up, lines formed, lists of beneficiaries were checked and food was being doled out 20 minutes or so after the Ataa staff arrived. The families were given bars of soap as well.

A woman who gave her name as Um Hossam, or the mother of Hossam, said she was picking up supplies for relatives from four families, or about 15 people — a bulky, heavy haul she could scarcely manage to cart away on her own. No one in her family had been able to find work, she said, and without the supplies, “we’d be begging.”

Fahim reported from Atmeh, Syria