Chinese President Xi Jinping scolds Canada's Justin Trudeau for leaking meeting details to the press

China's president has scolded Justin Trudeau for leaking details of a meeting in which the Canadian prime minister expressed concern about China allegedly interfering in Canada's affairs.

Their brief exchange at the G20 summit in Indonesia was overheard by a TV camera.

"Everything we discussed has been leaked to the paper; that's not appropriate," Xi Jinping told Mr Trudeau through an interpreter.

"And that's not... the way the conversation was conducted, if there is sincerity on your part," Mr Xi said, at which point Mr Trudeau interrupted.

"In Canada, we believe in free and open and frank dialogue and that is what we will continue to have," Mr Trudeau said.

"We will continue to look to work constructively together, but there will be things we will disagree on."

Mr Xi looked around as Mr Trudeau replied.

"Let's create the conditions first," Mr Xi responded through the interpreter, before the pair shook hands.

The Canadian PM and Mr Xi first spoke at the G20 last Tuesday.

A Canadian official said they discussed Ukraine, North Korea and climate change, and that Mr Trudeau raised "our serious concerns around interference activities in Canada".

Asked later at a news conference about the confrontation, Mr Trudeau said "not every conversation is always going to be easy, but it's extremely important that we continue to stand up for the things that are important for Canadians".

'He's red in the face'

Guy Saint-Jacques, a former Canadian ambassador to China, said he thinks Mr Xi berated Mr Trudeau in front of the camera on purpose.

"When you look at him, he is red in the face, he is moving his arms," he said.

"He looks agitated. Clearly, he was not pleased with Trudeau for leaking to press the detail of the meeting. Interesting he said it's not the way the meeting went."

Mr Saint-Jacques said it was likely Mr Xi wanted to send a message that Canada will not dictate the terms of the relationship and that Mr Trudeau had better take notice.

"It's very unusual to see Xi Jinping engaging in this kind of public exercise to criticise someone," Mr Saint-Jacques added.

Canadian foreign minister Melanie Joly also said she discussed interference with her Chinese counterpart at the G20.

Ms Joly said last week that China was an increasingly disruptive power and warned businesses against deepening ties with the country.

Canadian police charged a Hydro-Quebec employee on Monday with espionage for allegedly sending trade secrets to China.

Relations between Beijing and Ottawa have also deteriorated in the last few years after Canadian authorities arrested a top executive from technology firm Huawei who had been charged with fraud by the US.

China jailed two Canadians shortly after Canada arrested Meng Wanzhou - Huawei's chief financial officer and the daughter of the company's founder, on a US extradition request.

They were sent back to Canada last year, the same day Ms Meng returned to China after reaching a deal with US authorities in her case.

Many countries have accused China of engaging in "hostage politics", while Beijing has described the charges against Huawei and Ms Meng as a politically motivated attempt to hold back China's economic and technological development.

Canada has banned wireless carriers from installing Huawei equipment in its high-speed 5G networks, joining allies, including the UK, in shunning the company over its close ties with the Communist Party and the People's Liberation Army.