The United States and China have held constructive talks, the two sides said, after an unusually long meeting aimed at preventing bilateral tensions from spiralling out of control.

US Secretary of State Antony Blinken and Chinese Foreign Minister Wang Yi held their first talks since October on the Indonesian island of Bali as the two powers stepped up interaction at a time when the West is focused on Russia's invasion of Ukraine.

"Despite the complexities of our relationship, I can say with some confidence that our delegations found today's discussions useful, candid and constructive," Mr Blinken said after five hours of talks.

"The relationship between the United States and China is highly consequential for our countries but also for the world. We are committed to managing this relationship - this competition - responsibly," he said, promising to keep open channels of diplomacy with China.

China's foreign ministry said the two sides had broadly agreed to work to improve ties - but also reeled off a laundry list of grievances against the US, accusing the United States of "smearing and attacking" its political system.

"The two sides... reached a consensus to promote the Sino-US joint working group consultation to achieve more results," it said, reporting they "also agreed to strengthen cooperation on climate change and public health".

"Both sides believe that this dialogue is substantive and constructive, which will help enhance mutual understanding, reduce misunderstandings and misjudgements, and accumulate conditions for future high-level exchanges between the two countries," it added.

The meeting, in which the pair held morning talks and then a working lunch, largely focused on preventing competition spilling over into unintentional conflict but also US opposition to China on a range of issues including Taiwan and human rights.

"I conveyed deep concerns of the United States regarding Beijing's increasingly provocative rhetoric and activity towards Taiwan and the vital importance of maintaining peace and stability across the Taiwan Strait," Mr Blinken said.

He also voiced concerns over Ukraine, pressing Mr Wang on China's tacit support of the Russian invasion of its neighbour and calling for it to distance itself from Russia a day after the Kremlin's top diplomat faced a barrage of Western criticism at the G20 talks.

"This really is a moment where we all have to stand up, as we heard country after country in the G20 do, to condemn the aggression, to demand among other things that Russia allow access to food that is stuck in Ukraine," Mr Blinken said.

US officials have also been cautiously upbeat about China's stance on Ukraine, condemning its rhetorical backing of Russia but seeing no sign that the Chinese government is backing its words with material support.

Before the meeting started, Mr Wang told reporters Chinese President Xi Jinping believed in cooperation as well as "mutual respect" between the world's two largest economic powers and that there needed to be "normal exchanges" between them.

"We do need to work together to ensure that this relationship will continue to move forward along the right track," Mr Wang said in front of US and Chinese flags.

It was Mr Blinken and Mr Wang's first in-person meeting in months, and they are expected to prepare for virtual talks in the coming weeks between Mr Xi and US President Joe Biden as both powers increase engagement and moderate their tone.

After a long chill during the pandemic between the two countries, since last month their defence, finance and national security chiefs as well as their top military commanders have all spoken.

China's state-run Global Times, known for its criticism of the United States, wrote that the growing diplomacy "underscored the two sides' consensus on avoiding escalating confrontation".

US views of China have hardened in recent years and Mr Biden has largely maintained the substance of his predecessor Donald Trump's hardline approach of treating Beijing as the pre-eminent global competitor of the United States.

But in a recent speech Mr Blinken made clear that the US was not seeking a new "Cold War", even as he held firm on criticism - including accusing China of genocide against the mostly Muslim Uyghur people, an accusation he repeated after today's talks.

The Biden administration is widely expected soon to ease some of Mr Trump's tariffs on Chinese goods, a move that could ease soaring inflation, which has become a major political liability in the United States.