Image copyright AP Image caption Pro-democracy campaigners welcomed the outcome of the vote

Legislators in Hong Kong have rejected a controversial Beijing-backed election reform package that sparked mass protests last year.

The reforms would have given Hong Kong voters the right to choose their leader for the first time in 2017.

But candidates would be vetted by a pro-Beijing committee and pro-democracy activists said the reforms only offered "fake democracy".

Beijing said it would not change its position on democratic reforms.

Some in Hong Kong had hoped that if the proposals were rejected, China would be forced to offer more far-reaching reforms.

Voting confusion

The Chinese government issued a ruling on 31 August last year, saying that Hong Kong's leader could be chosen by direct elections by 2017.

However, the ruling also said that only those nominated by a pro-Beijing committee could stand for election.

Beijing's decision sparked protests that drew crowds of more than 100,000 people to the streets.

Media playback is unsupported on your device Media caption Pro-government lawmakers were filmed walking out moments before the vote

The Beijing-backed electoral reforms had to be approved by Hong Kong's legislature before they could be enacted - but pro-democracy lawmakers, who have enough seats to veto the move, voted down the reform package.

Without approval from Hong Kong lawmakers, the territory's next chief executive will be selected, as before, by a 1,200-member committee currently stacked with Beijing loyalists.

Moments before the vote took place, pro-Beijing lawmakers, who were expected to support the package, walked out of the council chamber.

This led to confusion ahead of the vote, with some lawmakers unsure as to why others had walked out.

The 37 remaining lawmakers voted and the motion was rejected with 28 opposing it and eight supporting it. It needed at least 47 votes to pass.

Pro-Beijing lawmakers later blamed miscommunication for the walk-out, after their request for a 15-minute suspension was rejected by the Speaker.

How it all unravelled for pro-Beijing side: Juliana Liu, BBC News, Hong Kong

The outcome was expected, but the circumstances surprisingly dramatic.

When government officials gave their final speeches, it was hours ahead of schedule. Journalists scrambled to retake their seats in the main chamber at the Legislative Council.

Then a bell rang, reminding lawmakers to gather to vote. The cavernous room echoed with tension. A voiced called out, asking to halt the proceedings with just minutes to spare. The head of the council declined. Pro-government legislators walked out in protest.

One of them, Regina Ip of the New People's Party, looked stunned after failing to vote. She said the collective action was unplanned. They had suddenly decided to wait for Lau Wong-fat, an elderly lawmaker who was said to be ill.

As a result, the controversial government reform plan failed by a wide margin.

Tardy lawmaker draws online quips

Maggoty apples and Hamlet: How Hong Kong's passionate debate unfolded

Image copyright Reuters Image caption The vote means the leader of Hong Kong will still be chosen by a 1,200-member committee

Image copyright AFP Image caption The reform gave Hong Kong citizens the right to vote for their chief executive for the first time in 2017

Image copyright Getty Images Image caption Hong Kong Chief Executive CY Leung said legislators had voted against the wishes of the majority

A statement from China's legislature released to Chinese state news agency Xinhua, said: "Although the universal suffrage motion was not passed, the direction towards universal suffrage and the legal principles laid down must continue to be upheld in future efforts."

It said the 31 August decision will "continue to serve as the constitutional ground for Hong Kong in the future" and "its legal force is unquestionable".

Hong Kong Chief Executive CY Leung said legislators had voted against the wishes of the majority of Hong Kong's people and he was "naturally disappointed".

Media playback is unsupported on your device Media caption Hong Kong's democracy debate explained - in 80 seconds

The bill's defeat comes after what has been a tense year of political debate in the former British colony that was handed over to Beijing in 1997.

In September last year, activists occupied major parts of the city and demanding universal suffrage. Protests paralysed the city centre after clashes between police and activists saw tear gas deployed.

After more than two months and with no concessions from CY Leung, the protest camps were ultimately dismantled by police.