When I moved to Hong Kong in 1987, after my books had been permanently banned by the Chinese government, the territory’s distinctive character was immediately obvious. The pungent, salty air smelt of freedom. In China’s huge city boulevards and vast deserts and mountains, my thoughts always felt imprisoned, but in Hong Kong’s narrow streets and tiny, cramped bookshops they were set free and given infinite space to wander. No printed word was banned, no thought outlawed. For 10 years, Hong Kong became a refuge where I could speak, write and be published in freedom, without fear of arbitrary arrest.

These basic civil liberties – security and free expression – are threatened by the passage of the much-reviled extradition bill that would allow suspected criminals to be sent to mainland China, where there is no chance of a fair trial.

Hong Kong’s civil liberties have been chipped away at for years: professors have been jailed, the tiny, subversive bookshops have closed. Four years ago, five booksellers were abducted and transported to China. One of them, Gui Minhai, is still in detention. His crime is to have written a book about President Xi Jinping’s private life.

Last November, I experienced the fear of abduction first hand. Shortly before setting off for the Hong Kong literary festival to discuss my novel China Dream, a satire of Xi’s tyrannical rule, I was told that the Tai Kwun arts centre no longer wished to host my events. Although the organisers promised to find an alternative venue, friends advised me not to go in case I suffered the same fate as Gui Minhai. But I went anyway, saying if no alternative venue was found, I would give my talks on the streets.

I couldn’t bear to think that Hong Kong might become a place where it was dangerous to talk about books. Thanks to the attention of the foreign press and the solidarity of fellow writers, Tai Kwun eventually reversed its decision, but from the moment I arrived to the moment I left I was terrified that on a street, in a taxi, or in my hotel room, I might be secretly abducted and sent to China. If the extradition bill passes, this fear would be felt by everyone in Hong Kong. Any critic of Xi’s regime, however moderate, could be legally and openly abducted.

A million Hongkongers demonstrated against the bill on 9 June. A week later, after the territory’s chief executive, Carrie Lam, announced the bill’s suspension, two million people – a quarter of the territory’s population – poured on to the streets to insist on its complete withdrawal. It was one of the largest peaceful protests in living history. Watching the breathtaking scenes unfold on my screen in London, it became clear that these protests transcend the bill, and have become a crucial moment in history, a milestone in the human struggle against tyranny.

For Chinese dissidents of my generation the two giant protests, coming just days after the 30th anniversary of the Tiananmen massacre, had strong echoes of 1989. Students, lawyers, parents, priests, people in wheelchairs, came out to peacefully fight for freedom. Volunteers set up supply stations and first-aid booths; locals sprayed water on to demonstrators to protect them from the sweltering heat. When an ambulance needed to pass, the sea of humanity spontaneously parted. Thirty years ago in Tiananmen Square, I witnessed similar scenes, and felt the euphoria of being a drop of water in a powerful, benevolent ocean of people. Huge crowds can easily become violent mobs. But in China in 1989, and in Hong Kong this month, they brought out the best of human nature: courage, wisdom, compassion.

Although the Chinese government crushed the Tiananmen movement and has erased all mention of it on the mainland, its spirit survives in Hong Kong. It is honoured each year at memorials in the territory’s Victoria Park, and now it is alive again in the streets of Admiralty and Causeway Bay. Hong Kong has become the custodian of China’s forbidden memories, moral conscience and quest for freedom.

When people gather together in great numbers for a just cause, they find a strength they didn’t know they possessed. In such crowds the passive individual becomes an active, autonomous citizen, a better version of themselves. They feel the suffering of others as keenly as their own.

Hong Kong’s fighting spirit was dampened by the arrests and imprisonments following the 2014 pro-democracy “umbrella” movement. But the extradition bill is the last straw. Denied universal suffrage, Hongkongers have found the courage once more to use the only weapon in their arsenal – their own two feet.

Václav Havel said that hope is “the ability to work for something because it is good, not just because it stands a chance of succeeding”. The Hongkongers are expressing hope in an even more powerful sense. They are protesting not because they believe they can succeed, but knowing that in all probability they will fail. They are protesting because fighting peacefully for civilised values is always the right thing to do.

Carrie Lam and her Beijing overlords have been forced on to the defensive. Hongkongers are standing up to China’s tyrants. Now the west must do so as well, and stop appeasing them for short-term economic gain. The UK must demand the Chinese government honours the Sino-British Joint Declaration, which guarantees Hong Kong’s way of life until 2047. At the G20 summit, world leaders should ignore the protestations of Beijing and insist on discussing not just the Hong Kong protests, but also the horrifying internment of Uighur Muslims in Xinjiang re-education camps. To simply raise these issues is not too much to ask of world leaders. All they need is a fraction of the courage, wisdom and compassion that the people of Hong Kong have shown.

• Ma Jian is the author of China Dream