Giving a statement to MPs in the Commons, Jarvis denied reports Mr Powell had ruled China could not be defined as a national security threat at a meeting of Whitehall officials in September, shortly before the charges were dropped.

“Of course, [the national security adviser] takes part in discussions about national security and diplomatic relations. That is literally his job,” he said.

“But any discussions were on the basis that the case would be going ahead and how to handle the implications.

“The national security adviser was not involved in any decisions about the substance of the evidence.”

Jarvis said it was deputy national security adviser Matthew Collins who provided a witness statement in December 2023 under the previous Conservative government, with further witness statements requested and provided in February and July this year.

He said Mr Collins was given “full freedom to provide evidence without interference”, adding: “Ministers and special advisers did not take decisions about that evidence and they were not cited on the contents.”

Jarvis said all the evidence provided was based on the law and the Tory government’s position on China at the time of the alleged offences.

He added that the decision about whether to proceed with the prosecution was taken by the CPS, “who were hamstrung by antiquated legislation”.

The Official Secrets Act of 1911 has since been replaced by the 2023 National Security Act, which Jarvis said closed “the loopholes that have been exposed by this particular case”.

“Suggestions that the government concealed evidence, withdrew witnesses, or restricted the ability of witnesses to draw on particular bits of evidence are all untrue,” he said.

“The [deputy national security adviser] did not materially change his evidence and was under no pressure from anyone to do so…

“What has changed is the CPS’s assessment of the case law.”

Jarvis sought to blame the previous Tory government for not classifying China as a threat to national security and being too “slow” to update national security laws.

Defending her party’s record, Badenoch pointed to a number of examples where Tory ministers and government documents had described China as a “threat”.

“The trial has collapsed because for months and months, the government has been refusing to give the CPS vital information,” she said.

“This wasn’t a mistake. This wasn’t a misunderstanding. This looks like a deliberate decision to collapse the case and curry favour with the regime in China.”

She added: “I suspect that [ministers] have decided that closer economic ties with China were more important than due process and our national security.”

The Liberal Democrats have called on the government to “come clean on why this case fell apart” and publish all correspondence between the deputy national security adviser and the CPS.

The party’s foreign affairs spokesperson Calum Miller said: “The government’s attempts to duck scrutiny and scapegoat a single official simply won’t wash.

“It’s inconceivable that neither Keir Starmer nor his national security adviser knew what evidence was being submitted in such an important case.

“The buck for this fiasco ultimately stops with the prime minister.”