Hong Kong has voted to ban ivory sales in a landmark move to end the infamous trade in the city.

Lawmakers overwhelmingly voted for Wednesday’s bill, which will abolish the trade by 2021, following China’s complete ban on ivory sales that went into effect at the end of last year.

“Shutting down this massive ivory market has thrown a lifeline to elephants,” said Bert Wander of global advocacy group Avaaz.

“Today is a great day for elephants. Hong Kong has always been the ‘heart of darkness’ of the ivory trade with a 670-tonne stockpile when international trade was banned in 1989,” said Alex Hofford of WildAid Hong Kong.

The amendment will phase out the trade in three stages, a time period some conservationists say could be exploited as a loophole and too late for African elephants which continue to be killed in huge numbers.

The steps include a ban on trade in hunting trophies and ivory dating from after 1975, when a global treaty regulating the trade took effect. It would later extend to ivory acquired before 1975, and finally traders would have to dispose of their stock by 2021.

Penalties for offenders will be increased to a maximum fine of HK$10m ($1.3m) and 10 years’ imprisonment.

Dozens of demonstrators including schoolchildren gathered outside the city’s legislature to protest against ivory sales holding up signs that read: “Do you really need ivory chopsticks?”

Angry ivory traders have said they will be forced to close down their businesses and demanded the government compensate them for their stock – which the new ordinance rejected.

Despite the planned ban, the trade was still flourishing in Hong Kong, which saw its biggest ivory bust in three decades last July when more than seven tonnes of tusks worth more than $9m were seized.

In the months ahead of Wednesday’s vote, the legislature heard tales of murder and suffering involving African park rangers who were shot dead while protecting elephants and others drowned or set on fire.

African ivory is highly sought after in China, where it is seen as a status symbol, and used to fetch as much as $1,100 a kilogram.

Poaching in Africa has seen the elephant population fall by 110,000 over the last 10 years to just 415,000, according to the International Union for Conservation of Nature.

Despite an overall fall in poaching, Africa’s elephant population has declined in part because of continued illegal killing, said a report last year by the Convention on International Trade in Endangered Species.