China is headed for a bruising clash with democrats in Hong Kong over its increasingly routine interference in the city's affairs, its new emphasis on the limitations of the territory's autonomy and, above all, on the arrangements for the election of the territory's leader in 2017. This was when many hoped that the provisions for indirect election through which Beijing has maintained informal control over Hong Kong politics would fall away and all adults would be able to choose a new chief executive from an unrestricted field of candidates.

Recent pronouncements by both Beijing and the Hong Kong government suggests this will not be allowed to happen, in spite of the huge demonstrations which have filled the streets and parks of the city over the summer. It is not impossible that serious violence could ensue, with some imagining that Chinese security forces might have to be brought in. That would be a dismal development for Hong Kong and profoundly counterproductive for China, with serious consequences in Taiwan, Japan and south-east Asia. China's president, Xi Jinping, would be wise to soften his line. Britain, which retains certain legal and moral responsibilities for Hong Kong, should make it clear that he should do so, but has so far been evading the issue.

Hong Kong is one of the world's great cities, a synthesis of British power, Scottish mercantile drive and Chinese intelligence, ingenuity and hard work. For most of its time under the British, it was run in a typically colonial way, with a technically efficient civil service flanked by committees of vetted local worthies to provide some quasi-democratic cover. The majority of its citizens, rich or poor, devoted themselves mainly to the business of making a living. This relatively quiescent community was probably what the Chinese expected to incorporate when they signed the Sino-British joint declaration in 1984. The declaration started the process which led to the handover of the city to the People's Republic in 1997, but, ironically, from the point of view of Beijing, it did so as Hong Kong began to flower politically and culturally. Its economy emerged from the sweatshop era, its universities expanded, its people began to travel and settle abroad and its middle class grew in numbers and sophistication. It saw cities such as Sydney, Melbourne, Vancouver and Seattle, where many of its young people went for their education, as its peers, and as models for its future. Britain's last governor, Christopher Patten, understood these changes and tried, to the obvious irritation of the Chinese, to accommodate them.

In the beginning the Chinese leaders probably saw the bargain behind the joint declaration more as between communism and capitalism than between one-party rule and democracy in the western sense. Hong Kong capitalists could get on with their job of making lots of money – although much more of it would end up in Beijing coffers than before – while Beijing would leave them alone, along with various quaint local customs, as long as they behaved in a "patriotic" way.

But Hong Kong had moved on, as had China itself. Hong Kong's democracy movement had roots in earlier attempts to get more representation in the British colony, but was also connected to reform aspirations on the broader Chinese stage, aspirations which were crushed or, at the very least, postponed by the Tiananmen Square massacre in 1989. It is symptomatic of the "delicate situation" which China then faced in Hong Kong that the annual Tiananmen commemoration in Victoria Park has become a powerful statement of identity and difference, and a way in which young people align themselves with the Chinese dissidents and liberals who try to keep the democratic cause alive in the People's Republic itself.

Clearly, unless and until democratic change in China and Hong Kong converge, there will be tension between Beijing and Hong Kong. But, as Lord Patten has said, that does not mean confrontation is unavoidable. Indeed, it makes it even more important that it be avoided, and Britain should publicly say so.