Image copyright Reuters Image caption By law, voters in Hong Kong need to have been Hong Kongers for five years before they can contest elections
Hong Kong residents of mainland Chinese nationality will be able to vote in legislative elections from next year.
The move by the top court is aimed at securing full democracy in the British-ruled financial hub, which will make it the first place to do so.
But critics say the system will be unfair, because many of those eligible to vote would not have lived in Hong Kong for five years.
The judges also ruled that the planned chief executive election in 2017 will be cancelled.
Hong Kong’s chief executive is currently an unelected body with no public accountability.
The government said that its plan for an executive election in 2017 “poses a threat to the freedom and fairness of the forthcoming legislative election in the courts”.
The court’s unanimous decision is expected to bring to an end one of the biggest threats to the Basic Law of rule of law established by Britain’s colonial rulers in 1997.
Image copyright Reuters Image caption The chief executive election has been cancelled
Under Hong Kong’s governance arrangements, if one of the two main political parties in the Legislative Council fails to win an absolute majority, then the chief executive must be nominated by a committee with 70% of its members being from the Chinese mainland.
Hong Kong residents are allowed to contest that election but under a provision from the original Basic Law which prevented “citizens of the People’s Republic of China” having a say.
The court’s five judges ruled that the law breaches the Basic Law’s principle of allowing people to cast their votes.
Image copyright AFP Image caption Hong Kong has seen tens of thousands protest against mainland access to the elections
Hong Kong was handed back to China in 1997 with some autonomy under a section of the Basic Law known as “one country, two systems”.
Since then, more than a hundred of the territory’s legislators, both Chinese- and Hong Kong-born, have been purged or forced to quit under a system known as the “umbrella revolution”.
The numbers of pan-democrats has almost halved in recent years, from nearly 200 last time to around 60 now.
Petitioners say they will take the court’s decision to the United Nations Human Rights Committee, the monitoring body of the UN.
They are still planning to press their application for the Hong Kong Judicial Commission to investigate four pan-democrats.