HONG KONG — A former employee of the British Consulate in Hong Kong said Wednesday that he was repeatedly tortured by Chinese secret police over 15 days in August and was accused of inciting pro-democracy protests in the territory on behalf of the British government.

Simon Cheng, 29, in his first public account of his treatment published on Facebook, described being handcuffed and shackled, blindfolded and hooded, deprived of sleep, made to sit absolutely still or hung in an uncomfortable spread-eagle position for hours on end, and constantly threatened during incessant interrogations.

British Foreign Minister Dominic Raab said his government was shocked and appalled by the “brutal and disgraceful treatment” that Cheng said he was subjected to after being detained during a business trip to Shenzhen in mainland China in August, and said it had summoned the Chinese ambassador in London to protest.

But China said its ambassador would never accept Britain’s “false allegations.”

Cheng’s detention reflects the growing bitterness between China and the West over the pro-democracy protests in Hong Kong, but his alleged treatment also reflects Beijing’s increasing willingness to flout diplomatic norms as it becomes more assertive in projecting its power worldwide.

Meanwhile in Hong Kong, police and protesters braced for a final showdown at a university in Hong Kong on Wednesday as a small group of anti-government demonstrators continued to hold out against a police encirclement.

Cheng’s account was released just a day after the U.S. Senate unanimously passed legislation aimed at protecting human rights in Hong Kong and threatening sanctions against officials who have violated human rights there.

Cheng said he was arrested at the border between Hong Kong and mainland China, accused of inciting the protests. He said he was then shackled to a steel “tiger chair” unable to move his arms or legs, and threatened with indefinite criminal detention, while being denied access to a lawyer and not allowed to contact relatives.

He was later transferred to the secret police, when he says he was handcuffed, shackled, blindfolded and hooded.

“I was hung (handcuffed and shackled) on a steep X-Cross doing a spread-eagled pose for hours after hours,” he wrote. “I was forced to keep my hands up, so blood cannot be pumped up my arms. It felt extremely painful.”

Cheng said they forced him to do “stress test” exercises for hours on end, beat him with what felt like a sharpened baton if he did not do so, including on his “vulnerable and shivering body parts,” such as his knee.

His treatment left him seriously bruised on his ankles, thighs, wrists and knees, he said.

“Sometimes, they instructed me to stand still (handcuffed, shackled, blindfolded, and hooded) for hours after hours,” Cheng wrote. “I was not allowed to move and fall asleep, and if I did, then I would be punished by being forced to sing the Chinese national anthem, which they said can ‘wake me up.’ This was the nonphysical torture — sleep deprivation — they used against me.”

Cheng said the British Consulate had asked him to collect information about the protests in Hong Kong, to evaluate travel alerts and ascertain whether British citizens were involved. That work involved joining messaging and discussion groups and establishing contacts with protesters.

However, that appeared to have drawn the attention of China’s surveillance state. Cheng said he was accused of being a British spy and an enemy of the Chinese state, and told to confess that the British government was instigating the protests in Hong Kong by donating money, materials and equipment.

Cheng said that he had a massage in Shenzhen “for relaxation” after finishing work there and that China accused him of soliciting prostitution. He said he was ultimately forced to record a video confession admitting to this offense, as well as a separate confession for “betraying the motherland.”

Britain’s Raab described Cheng as a “valued member” of the consulate’s team. “We were shocked and appalled by the mistreatment he suffered while in Chinese detention, which amounts to torture,” he said in a statement.

Chinese Foreign Ministry spokesman Geng Shuang referred questions on the subject to the Shenzhen police but said that Cheng’s rights had been guaranteed during his detention and that “himself admitted fully to his offenses.”

Since being released, Cheng has negotiated his exit from the British Foreign Service and is applying for asylum in an undisclosed location.

A diplomatic showdown was also brewing between China and the United States over the Senate bill passed Monday.

The bill would require the secretary of state to certify annually whether Hong Kong is sufficiently autonomous from China to justify its special trading status.

Failure to do so would effectively deal a massive blow to Hong Kong’s status as a global financial and trading hub, and the American Chamber of Commerce warned of possible “unintended, counterproductive” consequences that could undermine the territory’s unique place in the world.

China said Wednesday that it “strongly condemns and firmly opposes” the bill, which it said would blatantly interfere in China’s domestic affairs.

To become law, the measure must be combined with a separate bill passed by the House, and then President Trump must sign it.

Gerry Shih in Beijing and Tiffany Liang and Casey Quackenbush in Hong Kong contributed to this report.