Chinese and US negotiators held their first face-to-face talks on Wednesday since agreeing to a trade war truce last month, but the short meeting in Shanghai was overshadowed by a Twitter tirade from US President Donald Trump.

Washington and Beijing have so far hit each other with punitive tariffs covering more than $360 billion in two-way trade in a row centred on demands for China to curb the alleged theft of US technology and provide a level playing field to US companies.

US Trade Representative Robert Lighthizer and Treasury Secretary Steven Mnuchin shook hands and exchanged pleasantries with Vice Premier Liu He on Wednesday morning.

The group then went behind closed doors for around four hours in the first face-to-face negotiations since Trump agreed to a truce with his Chinese counterpart Xi Jinping in June following a breakdown a month earlier.

The talks were relatively brief and the group emerged later, a little earlier than expected, for a group photo before the US trade officials left for the airport without speaking to reporters.

Lighthizer and Mnuchin had arrived on Tuesday and joined Chinese officials for dinner and informal discussions – just as Trump took to Twitter to lambast what he said was a lack of willingness by Beijing to broker a fair deal.

The US leader said Beijing was supposed to start buying US agricultural products but they had shown “no signs that they are doing so”.

“My team is negotiating with them now, but they always change the deal in the end to their benefit,” Trump wrote on Tuesday.

Trump had previously accused China of reneging on its commitments when talks broke down in May, and his tweets sent hopes of reconciliation tumbling.

“Whatever shred of optimism markets had about the ongoing trade negotiations were dealt as a severe blow when President Trump flew off the handle again,” said Stephen Innes, managing partner at VM Markets Singapore.

A commentary in the Communist Party mouthpiece People’s Daily on Wednesday said that as the talks started, “the drums of some Americans struck again on the side, disturbing the main melody”.