Prime Minister Justin Trudeau told a public inquiry he found it “very unlikely” the Chinese government would prefer his Liberal Party to win recent elections, given the high tensions between the two countries.

Trudeau was testifying at an inquiry into foreign interference in Canadian elections, particularly by China. The inquiry was prompted by a series of media leaks last year that cited intelligence memos alleging China was orchestrating efforts to get certain candidates elected in Canada.

One media story alleged a Chinese diplomat boasted he had helped ensure Trudeau’s Liberal Party won a minority government in parliament, and that such an outcome was best for China.

But Trudeau rejected the idea China successfully interfered, saying every briefing he’s received from his intelligence and security officials indicates the elections “held their integrity” and “were decided by Canadians.”

He also disputed the claim China favored his party, pointing out both the 2019 and 2021 elections took place during “significant tensions” between Canada and China. Two Canadian citizens, Michael Spavor and Michael Kovrig, had been detained by China in apparent retaliation for Canada’s arrest of Huawei’s Chief Financial Officer Meng Wanzhou on a U.S. extradition request.

Trudeau said Canada was “extremely active” in pushing back on China during this time, including through a global effort for democracies to have a coordinated policy against arbitrary detentions.

He said while individual diplomats “may well have expressed a preference” in terms of who should govern Canada, “it just would seem very unlikely that that the Chinese government itself would have a preference in the election,” Trudeau said.

More broadly, he also defended his government’s response to the foreign interference threat, and said it was difficult to respond to the allegations being aired in the media based on leaked intelligence.

The requirement to keep national security information confidential left his government “limited on what we could actually rebut, regardless of the fact that there were inconsistencies, uncorroborated information in the leaks,” Trudeau said. “There were also things that were flat out wrong.”

Some of the leaked intelligence that prompted the inquiry alleged Chinese agents had tried to help elect certain candidates who were deemed friendly to China’s interests. Overall, the leaks raised questions about whether Trudeau’s government had responded strongly enough to prevent foreign interference.

Trudeau’s first response to the leaks was to appoint a “special rapporteur” to review the classified intelligence and provide a report. But the rapporteur, former governor general David Johnston, resigned after the Conservatives and other critics challenged his independence by citing his personal ties to Trudeau’s family.

In September, Trudeau relented and called a public inquiry into the allegations of election meddling not only by China, but other countries including Russia, India and Iran.

It began public hearings in January. Intelligence officials, senior bureaucrats, political aides and politicians have given testimony to the inquiry. It has also published a trove of government memos and other documents, though much of it is redacted for national security reasons.

On Tuesday, senior aides to Trudeau testified that much of the intelligence cited in the media reports was piecemeal and in some cases contradicted by other information. They also said not all of the intelligence cited by media had even been briefed to Trudeau’s office due to its incomplete nature.

“What happens with the leaks is that pieces of intelligence reporting get taken out of context,” testified Jeremy Broadhurst, who has run recent Liberal election campaigns and served in senior roles inside government.

A large amount of the questioning focused on former Liberal lawmaker Han Dong. Some media reports alleged that Chinese agents had bussed in foreign students to help Dong win the Liberal nomination in his Toronto-area riding ahead of the 2019 election.

But Broadhurst testified he was never given concrete evidence on this by the intelligence briefings, and told Trudeau that there not enough of a basis to disqualify Dong. He told the inquiry that the “bar should be extremely high” when it comes to overturning a vote in a nomination race, a message echoed by Trudeau.

Dong won that election and still serves in parliament, but resigned from the Liberal caucus last year after another media report alleged he spoke to Chinese diplomats in Toronto in 2021 and advised them not to release Spavor and Kovrig for political reasons. Dong denies the allegation.

Another senior Trudeau aide, deputy chief of staff Brian Clow, told the inquiry that he had reviewed the intelligence on the matter and concluded the media report was wrong.