“Everyone in Hong Kong can see that the central authorities, including the top leaders in the country, have been very supportive of my work over all these years,” he said, a denial that he was dropping out because of Beijing’s disapproval.

In a statement, the Chinese government’s Hong Kong and Macau Affairs Office said it was “regretful” of Mr. Leung’s decision not to run and praised his contribution in upholding national sovereignty and stability in Hong Kong.

Mr. Leung was accused last week of waging a “coup” as he tried to unseat four elected pro-democracy legislators with a legal challenge over the way they took their oaths of office. An earlier judicial review he initiated disqualified two separatists from taking places in the legislature, but his move to challenge the four seated lawmakers, who do not advocate Hong Kong’s independence from China, was seen as a broader crackdown on opposition.

The six politicians targeted by Mr. Leung were among more than 10 who inserted political statements into their oaths of office in October. Two of them, the pro-independence Sixtus Leung and Yau Wai-ching, added an alternative name for China that many see as derogatory and pledged allegiance to the Hong Kong “nation,” prompting a rare legal intervention from the Chinese government.

“The timing of this is an attempt to relieve pressure in society against the government’s suppression of legislators,” said Nathan Law, who is among the four legislators whose qualification for office is being challenged. “There may be a stick following the carrot. We must not let our guards down.”