Hours before US helicopters landed at the compound of Nicolás Maduro, the president of Venezuela said he had enjoyed a "pleasant evening" with Chinese diplomats.
In a meeting with Chinese President Xi Jinping's special envoy for Latin America, Qiu Xiaoqi, the two countries reaffirmed close ties and commitment to "building a multipolar world of development and peace", Mr Maduro said afterwards.
Beijing has since emerged as one of the strongest critics of the move by US President Donald Trump to capture Mr Maduro and his wife for criminal proceedings on a range of charges.
"Release them at once," a statement from the Chinese Foreign Ministry said on Sunday.
"Stop toppling the government of Venezuela.
"Such hegemonic acts of the US seriously violate international law and Venezuela's sovereignty, and threaten peace and security in Latin America and the Caribbean region."
China slammed reports that the Trump administration ordered acting Venezuelan President Delcy Rodríguez to cut ties with US adversaries China, Cuba, Russia and Iran as "bullying".
Yet, despite an "all-weather strategic partnership" with Venezuela, China has not moved beyond condemnation of Washington.
The largest buyer of Venezuelan oil
China has spent decades deepening its ties with South America, investing billions in infrastructure projects to help advance its reputation and economic interests.
One of the strongest US allies in the region, Colombia, became the 22nd country in Latin America and the Caribbean to join China's Belt and Road investment initiative in May last year.
Since 2000, China has replaced the US as the largest or second-largest trading partner of almost every country in the region, said University of Melbourne Latin American studies professor Adrian Hearn.
The "uncertainty and instability" caused by hiked US tariffs under Mr Trump had only accelerated this trend, Professor Hearn said.
"China has opened up an alternative for Latin America," he said.
It is Venezuela's biggest customer for oil exports, which represent about 95 per cent of the South American country's overseas revenue — a vital economic lifeline amid US sanctions.
Growing Chinese influence in the region has long worried Washington.
After the seizure of Mr Maduro, US Secretary of State Marco Rubio said it would not allow "the Western Hemisphere to be a base of operation for adversaries, competitors, and rivals of the United States".
The timing of the operation against Mr Maduro may thus have been a deliberate "act of intimidation", said Oliver Villar, an expert on Latin American geopolitics at Charles Sturt University.
"You see this as a desperate act of a declining power," Dr Villar said, describing it as a "brazen attempt" to warn countries against becoming too close to China.
"But of course the Chinese, like its main partner Russia, don't scare easily," he said.
"The strength of China's foreign policy in both geopolitical and geo-strategic means is that it does business with everyone."
That even included Argentina, Dr Villar said, where President Javier Milei is "one of Trump's key allies".
Maduro toppling 'not an existential threat' to Chinese interests
Chinese companies are among the only foreign-owned businesses still operating in Venezuela.
The state-owned China National Petroleum Corporation runs a number of joint ventures in the country.
The American Enterprise Institute, a Washington-based think tank, estimates some US$2.1 billion ($3.1 billion) in Chinese investment flowed to Venezuela's oil sector between 2016 and 2023.
The capture of Mr Maduro and heightened instability in Venezuela therefore leaves China exposed.
Outstanding debt to China is estimated to exceed US$10 billion ($14.9 billion) — and there are questions whether this will ever be repaid.
"But at the end of the day, it's not an existential threat to China if these loans fall through," said China-Global South Project editor Eric Olander.
The much larger economy of Brazil was at the "epicentre" of Chinese engagement in Latin America, he told ABC's The World.
"When we look at Venezuela, it's important, but it's not in the top tier of the geopolitical hierarchy for China in that region," Olander said.
Despite China being the largest buyer of Venezuelan oil, it only accounted for around 4 per cent of China's overall crude imports last year.
And while Mr Maduro has been removed from power, his administration remains largely intact.
Some analysts argue China is well-positioned to engage with those left in power.
"Beijing has consistently pursued engagement with all viable political actors, regardless of ideology," Margaret Myers, director of the Asia and Latin America program at the Inter-American Dialogue, told Bloomberg.
"[It] is likely to maintain what presence it can over the long term in light of its substantial investments and Venezuela's strategic importance."
Charles Sturt's Dr Villar said China's approach was not to engage the US through conflict.
"China's strategy is to emerge as the adult in the room," he said.
As Mr Maduro's trial began in New York this week, Chinese Foreign Ministry spokesperson Mao Ning said: "No country can act as the 'world policeman', and no country can proclaim itself the 'international judge'.
"We stand ready to work with all countries to uphold the authority of international law," she said.
What happens next?
Mr Trump has said US oil companies will enter Venezuela to "spend billions of dollars, fix the badly broken infrastructure, oil infrastructure, and start making money for the country".
Venezuela has the largest proven oil reserves in the world, but production has declined significantly in recent years.
The International Energy Agency reports it produced around 860,000 barrels per day in November last year — less than a third of the amount Venezuela was producing a decade ago.
It would require an estimated US$100 billion in investment and more than a decade to bring Venezuela's sector back to previous production levels, said Professor Hearn from the University of Melbourne.
"That's a lot of money, it's a lot of time, and it's really not certain that US companies would want to put up that kind of cash," he said.
Meanwhile, Mr Trump has entertained the idea of further military interventions in the Americas, suggesting a similar operation in Colombia, which neighbours Venezuela, "sounds good to me".
The US secretary of sate Mr Rubio also hinted at targeting Cuba, which is closely allied with Venezuela.
"If I lived in Havana and I was in the government, I'd be concerned," he said.
Some analysts have suggested US actions in Venezuela could embolden China to act against Taiwan.
"US opponents will no doubt play up the lack of a clear justification under international law," said Bronwen Maddox, director of the London-based think tank Chatham House.
"Russia will use US actions to bolster its justifications for its invasion of Ukraine. China may cite Venezuela in its rhetoric regarding Taiwan."
The China-Global South Project's Olander argued that, as with the removal of Saddam Hussein in Iraq, the political instability caused by the fall of Mr Maduro could easily backfire against Washington.
"It's just too early to suggest if it's a blow [to Chinese interests in Latin America] or not," he said.
"We could be in a situation next year at this time where there's an anti-American push in Venezuela that turns in favour of China."
[Embed Venezuela Zen Desk Form]