Hong Kong’s high court has ruled that two pro-independence lawmakers are disqualified from taking their seats in the Legislative Council.
Sixtus Leung and Yau Wai-ching refused to pledge allegiance to China when being sworn in last month.
Last week, Beijing pre-empted the ruling by saying that those who did not take the oath properly could not take office.
Thousands protested, calling it a violation of judicial independence.
But there have also been protests against calls for further independence for Hong Kong.
China reminds Hong Kong who’s in charge
Who are Hong Kong’s new young lawmakers?
What is Hong Kong’s political controversy about?
Mr Leung has pledged to appeal against the court’s decision, saying it would affect Hong Kong for decades.
“I’ll soon discuss possible legal actions with my lawyers,” he told the South China Morning Post.
Leung added that he did not regret what he had done.
Hong Kong is semi-autonomous under the “one country, two systems” framework in place since it was returned to China in 1997.
But its mini constitution, the Basic Law, states Beijing still has the final say in how to interpret its laws.
The seats of Mr Leung and Ms Yau, from the Youngspiration party, are now vacant after the duo “declined” to take their oaths, Judge Thomas Au ruled on Tuesday.
Judge Au said he had arrived at his conclusion independent of the Basic Law interpretation by Beijing.
He added that he agreed with the government’s view that Mr Leung and Ms Yau “did not recognise the principle of ‘one country, two systems'”.
The judicial review was sought last month after both the lawmakers attempted to take their oaths several times, but provocatively changed the wording.
They were both elected in September.
In a swearing-in ceremony in October, the duo used profanities while taking their oaths.
They also displayed a pro-independence banner. Their oaths were later invalidated.
The Beijing ruling states that lawmakers taking their oaths must do so “sincerely and solemnly”. They must “accurately, completely and solemnly” read out the portion of the oath that swears allegiance to Beijing.
The interpretation by Beijing’s rubber-stamp parliament, the National People’s Congress (NPC), marks the Chinese authorities’ most far-reaching intervention in Hong Kong since the handover.
Li Fei, deputy secretary of China’s top legislative panel, warned there would be “no obscurity and no leniency” in Beijing’s “firm and clear attitude towards containing and striking the Hong Kong independence forces”.