British Foreign Secretary Jeremy Hunt was crticiised for his comments on protests in Hong Kong. (File)

British Foreign Secretary Jeremy Hunt should not use China in his campaign to become the next prime minister by "speaking unduly" about the country, its Foreign Ministry said on Thursday, after he criticised China's rights record.

China has attacked Hunt for his comments on protests in the former British colony of Hong Kong, which returned to Chinese rule in 1997, calling him "shameless" for warning of consequences if China neglected commitments to basic freedoms.

On Wednesday, Hunt said countries that restrict media freedom must be made to pay a diplomatic price, as he warned about a deteriorating situation in China and elsewhere.

In Beijing, a foreign ministry spokesman said he was unaware of Hunt's latest comments on China.

"But I've noticed the competition for the leadership of the Conservative Party at the moment in Britain," the spokesman, Geng Shuang, told a daily news briefing in Beijing.

"I know that many people are working for the leadership of the Conservative Party, and then become Britain's new prime minister."

He added, "This an internal affair for Britain. But I hope that certain people in Britain, including Mr Hunt, during the election don't speak unduly about China, hoping to use this to get votes for their election, or in service of it."

Hunt is the underdog in the race to succeed Theresa May as British prime minister, facing off against former foreign minister Boris Johnson.

Britain and China have talked about a recent "golden era" in ties, but it has been clouded by arguments over the disputed South China Sea, through which Britain sailed a warship last year close to Chinese-occupied islands, and more recently, over protests in Hong Kong against a now-shelved extradition bill.