Image copyright AP Image caption The demonstration brought large parts of Hong Kong to a standstill

Tens of thousands of protesters have taken part in what organisers say could be Hong Kong's largest pro-democracy rally in a decade.

Organisers said turnout was 510,000, while police said about 98,600 took part during the peak of the march.

The annual rally, marking the day Hong Kong was returned to China in 1997, was to demand full electoral freedom.

It came after an unofficial referendum on how to choose Hong Kong's next chief executive drew close to 800,000 votes.

China says it will introduce universal suffrage for the 2017 election - but wants the final say over who can run.

The Hong Kong government said the 10-day referendum had no legal standing.

Media playback is unsupported on your device Media caption Organisers were hoping more than half a million people would attend, as Juliana Liu reports

While organisers put the number of those joining Tuesday's rally from Victoria Park to the city's Central district at more than half a million, the University of Hong Kong's public opinion programme estimated a turnout of between 154,000 and 172,000.

The organisers' figure would make the march the largest since 2004, when 530,000 were estimated to have taken part in a pro-democracy demonstration.

The annual 1 July rally first gained prominence in 2003, when half a million people demonstrated against proposed anti-subversion laws which were later scrapped.

'Unauthorised sit-in'

Roads around Victoria Park were closed off and footage showed key roads jammed with marchers.

Reports said protesters were still in the park as the first marchers arrived in the Central district four hours later, giving an idea of the scale of the rally.

Security was tight, with about 4,000 police officers on patrol.

After the march, hundreds of protesters staged a sit-in in the Central district. Police said the sit-in was "unauthorised" and began removing some of the participants in the early hours of Wednesday.

Some demonstrators linked arms in a bid to resist being moved.

Image copyright AFP Image caption Activists called for greater democracy in Hong Kong

Image copyright Reuters Image caption Protesters filled Victoria Park, where the march began

Image copyright AFP Image caption Some demonstrators staged a sit-in in the business district after the rally

Image copyright AP Image caption Police began removing those at the sit-in early on Wednesday

At the scene: Juliana Liu, BBC News, Hong Kong

Chanting "genuine democracy" and "CY Leung step down", tens of thousands braved the heat and rain to march for full voting rights.

CY Leung, the current chief executive, was elected in 2012 by a committee of just 1,200 members, who were believed to be largely loyal to the Chinese government. The protesters fear that in 2017 the shortlist of candidates to replace him will selected by a similar group, making universal suffrage essentially meaningless.

But that is exactly what is likely to happen, unless there is some kind of compromise.

A senior Hong Kong government official told reporters recently that the next chief executive must be appointed by Beijing.

'Stability, prosperity'

Speaking earlier at a ceremony to mark the 17th anniversary of the former British colony's return to China, Hong Kong leader CY Leung said that the government was trying hard to forge a consensus on political reform.

"Only by maintaining Hong Kong's stability can we sustain our economic prosperity. Only by sustaining Hong Kong's prosperity can we improve people's livelihoods," Mr Leung said.

The unofficial referendum, organised by campaign group Occupy Central, allowed the public to decide which of three proposals - all of which involved allowing citizens to directly nominate candidates - to present to Beijing.

Hong Kong was handed back to China in 1997 following a 1984 agreement between China and Britain.

China agreed to govern Hong Kong under the principle of "one country, two systems", where the city would enjoy "a high degree of autonomy, except in foreign and defence affairs" for 50 years.

As a result, Hong Kong has its own legal system, and rights including freedom of assembly and free speech are protected.