Sir Keir’s three-day trip to China – the first by a British prime minister since 2018 – is an attempt to thaw relations with the country, which is the second-biggest economy in the world behind the US.

The prime minister said the UK’s relationship with China was in a “good, strong place” following his talks with Xi at the Great Hall of the People in Beijing on Thursday.

Sir Keir said he knew the sanctions on MPs and peers were “a cause of concern, which is why I did raise it”.

He said the lifting of those restrictions “rather vindicates my approach because it’s only because we’re here that we have had the engagement and that has provided the opportunity for a leader-to-leader discussion on sensitive issues”.

But there is disquiet among critics of China who argue the country has a poor record on human rights and poses a threat to the UK’s national security.

The Conservatives have argued Sir Keir should not have visited the country and that the trip was not in the national interest.

“Keir Starmer went to China from a position of weakness and got absolutely nothing in return,” Conservative leader Kemi Badenoch said.

“He has gone to China with a begging bowl because his entire economic policy is dependent on China.”

Reform UK leader Nigel Farage called on the prime minister to reject trade deals with China until pro-democracy campaigner Jimmy Lai is released.

“I don’t think we should be doing any trade deals until a British citizen, Jimmy Lai, is let out of prison” he said.

“The fact that a guy on Hong Kong, who ran a free press – it wasn’t propaganda, it was a free press sheet – has now been for five years in solitary confinement in Hong Kong.

“This is a British citizen. It’s the job of the British government to stand up and defend him, so before we sign anything let’s free people like him.”

In the interview, Sir Keir was also asked about President Trump’s comments about the his trip to China.

The prime minister suggested the remarks “look to me as though they were directed more at the Canadians than us” and said the UK had discussed the China trip with the Trump administration.

Earlier this week, the US president threatened to impose tariffs on Canada if it went through with economic deals struck with China on a recent visit to Beijing by its Prime Minister, Mark Carney.

Trump has agreed to visit Beijing in April and has invited President Xi for a state visit to the US later this year.

On his trip, Sir Keir struck a number of deals with China, including an agreement aimed at tackling organised crime and illegal immigration will see the UK and China share intelligence to identify the supply routes of people smugglers.

Other deals include agreement to co-operate on reducing red tape for UK exporters and collaborate on health challenges such as antimicrobial resistance.

Sir Keir arrived in Shanghai on Friday morning, his last stop in China before leaving for Tokyo to meet his Japanese counterpart, Sanae Takaichi, for a working dinner.