UNITED NATIONS (AP) — Rival U.S. and Russian resolutions to extend the mandate of experts trying to determine who was responsible for chemical attacks in Syria were defeated Thursday at a heated Security Council meeting that reflected the deteriorating relations between Washington and Moscow.

The result of the two votes means that the expert body — the Joint Investigative Mechanism known as the JIM — will cease operations when its current mandate expires at midnight Thursday.

The U.S., its allies and human rights groups called it a serious blow to efforts to hold accountable those responsible for carrying out chemical weapons attacks in Syria.

During a three-hour drama, Russia first vetoed the U.S. draft resolution which was supported by 11 of the 15 Security Council members. Bolivia joined Russia in voting "no" and China and Egypt abstained.

Russia's U.N. Ambassador Vassily Nebenzia withdrew the Russian resolution over Moscow's insistence that it be voted on second not first as required under council rules. But using another council rule, Bolivia then resubmitted and called for a vote on that resolution.

It failed to receive the minimum nine "yes" votes required for adoption. Only Russia, China, Bolivia and Kazakhstan voted in favor while seven council members voted against and four abstained.

Japan late Thursday proposed a 30-day extension of the JIM and the Security Council was expected to discuss it on Friday.

At the heart of the dispute was the demand by Russia, Syria's most important ally, for major changes in the way the JIM operates and the U.S. insistence that the JIM's current mandate and independence be preserved.

After the votes, the United States and Russia blamed each other for ending the JIM's operations, both insisting they wanted it to continue.

"To my Russian friends, the next chemical weapons attack is on your head," U.S. Ambassador Nikki Haley said. "By not having a JIM, you are basically telling the entire world that chemical weapons are OK to use. That's what we should be embarrassed about today."

Russia's Nebenzia shot back saying: "Today it became absolutely clear we need a robust professional mechanism that will help to prevent the threat of chemical terrorism in the region, and you need a puppet-like structure to manipulate public opinion — which on the basis of false information will time after time accuse the Syrian government of violating international norms."

Those who voted against the Russian resolution put forward by Bolivia "bear the full brunt of responsibility for the cessation of the operations of the JIM," Nebenzia said.

Russia has been highly critical of the JIM's findings that the Syrian government used chlorine gas in at least two attacks in 2014 and 2015, and used sarin in an aerial attack on Khan Sheikhoun last April 4 that killed about 100 people and affected about 200 others who survived the nerve agent.

Syria repeated its denial of using chemical weapons.

The JIM has also accused the Islamic State extremist group of using mustard gas in 2015 adsnd again in September 2016 in Um Hosh in Aleppo.

Nebenzia accused the JIM of "fundamental flaws" in blaming President Bashar Assad's government for the attacks.

He cited its use of "remote working methods" and failure to visit Khan Sheikhoun, "focusing solely on dubious testimony from opposition and even terrorist groups, the disregard for the whole range of rules and methods provided for under the Chemical Weapons Convention."

Haley countered that Russia and its allies "want a JIM that doesn't have independence."

"They want a JIM that doesn't have reporting," she said. "They want a JIM that they can micromanage, or that any member can micromanage."

Haley noted that this was the 10th veto by Russia to support Syria.

"You have to realize when a country is playing games with people's lives," she said. "That's exactly what is happening here. And it's been happening for 10 times."

The vote took place against the backdrop of the military and political situation in Syria, where Assad's forces have gained the upper hand. A new round of U.N.-hosted Syrian peace talks is scheduled to start in Geneva on Nov. 28.

Haley said: "The only thing that today has proved is that Russia cannot be trusted in the political process with Syria."

"Russia will not be a good and trusted actor because they want to control who's at fault," she said. "They want to control what happens. They want to control that area because they want to work with Iran and Syria to make sure that they have it all under control."

Nebenia said Haley "betrayed what was trying to be hidden all the time, but in fact the whole thing was envisaged and invented to show that Russia should not be trusted in the Syrian political process."

"It's not coincidental," he said, "because the political process in Syria is ... slowly gaining momentum and Russia is very instrumental in it. And so this is the very opportune moment to tell that Russia should not play the role here."

Nebenzia said he didn't think Thursday's votes would affect the Geneva talks which Russia supports.