Former lawmaker Lau Siu-lai won her election petition over being barred from running in a 2018 Legislative Council by-election as the High Court declared that Rebecca Chan Hoi-yan was "unduly elected."
The High Court concluded that it was unfair for Lau to be denied the chance to explain her political views before she was banned.
Chan has 14 days to consider whether to appeal, during which time she will remain a lawmaker.
Lau, 44, from Democracy Groundwork, was disqualified from the Legco amid the 2016 oath-taking controversy.
She planned to participate in the by-election for the Kowloon West geographical constituency in 2018, but she was barred from doing so.
Returning officer Franco Kwok Wai-fan said he believed Lau had always considered Hong Kong independence an option and that she also refused to acknowledge the central government's authority over the SAR.
In the election petition, Lau challenged Kwok's decision, saying she was denied a chance to explain her political views before she was barred.
In a written judgment handed down yesterday by Justice Anderson Chow Ka-ming at the Court of First Instance, Chow wrote that being denied a chance to respond by the returning officer was a "material irregularity."
The fundamental right to stand in an election is protected by the Basic Law, he said, adding there was no perceivable "urgency" that merited denying Lau "a proper opportunity to respond before making a decision which adversely affected her fundamental right." He ruled that Chan and Kwok must pay the costs of the election petition to Lau.
Speaking after the ruling, Lau described her win as a "pyrrhic victory" and that she was prepared for Chan's appeal.
"It establishes that there must be procedural fairness," she said. "However, even after hearing your explanation, the returning officer still has the power to disqualify you. It is a political decision."
She said the biggest takeaway was that the case established one's disqualification from Legco should not bar the person from standing in future elections once and for all.
Chan said she regarded the ruling as a "small obstacle" in her career and planned to continue in her role as a lawmaker. She will seek legal advice before deciding on an appeal.
Legco yesterday suspended its meeting for an hour to discuss Chan's status.
President Andrew Leung Kwan-yuen said Chan will be provided 14 days from the date of the written judgment to appeal her case, meaning the ruling would not take effect until June 10.
If Chan decides to appeal, she will remain a lawmaker until the court ruled on it - similar to arrangements during the case of Au Nok-hin and Gary Fan Kwok-wai, he said.
The High Court ruled in September that Demosisto member Agnes Chow Ting and localist Ventus Lau Wing-hong were wrongly banned from running in 2018 by-elections on Hong Kong Island and in New Territories East respectively. Au and Fan, elected in the by-elections, lost their seats after the city's top court refused to hear their appeals.