Since Russia invaded Ukraine, the United States has sought to isolate Moscow and pressure China to keep its distance. With war in the Middle East, Russia and China are seeking to turn the tables.
The United States has cast Russia as the disruptor of the international order at the Security Council, with President Joe Biden promising the world body that Washington would use its veto only sparingly.
But the United States went ahead and vetoed a draft resolution last week it deemed insufficiently supportive of its ally.
In comments likely aimed at consumption in the Islamic world, Russia has accused the United States of escalating the conflict through military reinforcements, while China has lashed out at the US veto and Israel's actions.
The Chinese and Russian reprimands ring hollow for US officials, who doubt the rival powers will engage in painstaking diplomacy along the lines of Secretary of State Antony Blinken's recent trip to the region.
But the United States has historically stood out as a lonely voice in its close embrace of Israel, even if for now European allies are largely joining Biden in backing Israel.
Biden on taking office had aimed to shift from the complexities of the Middle East, seeing China as the greatest long-term challenge to the United States.
"This is not a region where the US has wanted to have a heavy footprint and be actively engaged. At the same time, this president in particular is deeply committed to Israel," said Leslie Vinjamuri, director of the US and Americas program at Chatham House.
China "is quite willing to see the US pulled sideways in its strategic focus into a region that it hasn't wanted to be absorbed by, but now is willingly," she said.
Hamas militants stormed into Israel on October 7, killing at least 1,400 people, mostly civilians, including inside homes and at a music festival, and taking more than 220 hostages, according to Israeli officials.
More than 5,700 Palestinians, also mostly civilians, have been killed across the Gaza Strip in retaliatory Israeli bombardments, the territory's Hamas-run health ministry said.
The Hamas assault came 50 years after a sneak attack by Egypt and Syria on Israel on the Jewish holiday of Yom Kippur. The two events have drawn parallels but among differences -- Russia was then a major player that backed the Arab states.
Russia returned in force in 2015 to Syria to back Bashar al-Assad, although Russian President Vladimir Putin has also maintained ties with Israel.
"Nobody is expecting Russia to produce any results here -- any kind of ceasefire or any role in trying to negotiate the release of hostages," said Eugene Rumer, director of the Russia and Eurasia program at the Carnegie Endowment for International Peace.
"Since 2022, it has all been about Ukraine, so when this tragedy occurred, it was a gift for Putin because suddenly the attention is diverted away," Rumer said.
Biden has tried to link Putin and Hamas, charging in an Oval Office address last week that both were "tyrants" seeking to "completely annihilate a neighboring democracy."
Russia denounced the remarks. At the Security Council on Tuesday, Russian envoy Vassily Nebenzia accused the United States of failing to respond to global demands for a full ceasefire.
China and the United States have both sought diplomatic advantage in the crisis, including through a call between Blinken and Chinese Foreign Minister Wang Yi.
The United States has repeatedly pressed China to play a greater role in the Middle East crisis commensurate with its global aspirations and urged it to use its influence over Iran's clerical rulers, who back Hamas.
Beijing has sent an envoy to the region who has highlighted support for the Palestinian cause.
Jonathan Fulton, an expert at the Atlantic Council on China's role in the Middle East, said that Beijing in its messaging saw the crisis "as an opportunity to score points on the US."
He said China likely hoped in turn to win support in the Arab and Islamic world for its priorities -- sidelining Taiwan, the self-governing democracy claimed by Beijing, and rejecting US-backed allegations that Beijing is committing genocide against Uyghur Muslims.
But Fulton said that Beijing's foremost interest in the Middle East remained economic, with the world's second largest economy heavily dependent on imported oil.
With its limited security and diplomatic resources in the Middle East, China has a two-fold interest in keeping the United States focused on the crisis.
"Obviously for China, it is better if the US is bogged down in the Middle East and the Gulf," Fulton said.
"But if the US keeps providing the security architecture that maintains the Middle East, China is not going to have to do heavy lifting on its own."