Chen Zuoer, a Beijing official who helped negotiate Hong Kong's return to Chinese rule 15 years ago, said on a recent visit that he was "heartbroken" to learn that Hong Kong protesters have taken to waving colonial-era flags emblazoned with the British Union flag. "Those flags should be sent to history museums, rather than being displayed in the streets," said Chen.

In some way, though, the appearance of old emblems of empire among demonstrators with gripes against Beijing has been a propaganda gift to China's ruling Communist party, which has long dismissed protests in Hong Kong as the work of traitorous conspirators loyal to foreign powers, particularly Britain and the US.

Ta Kung Pao, a Hong Kong newspaper controlled by the party, seized on the flag-waving as evidence of the danger posed by a small group of "ambitious wolves" bent on bringing chaos to the former colony in the service of China's foes. "There is no need for Chen Zuoer to be heartbroken," the newspaper intoned, asserting that most Hong Kongers embrace their city's "inseparable ties to the motherland".

The number of people parading colonial-era symbols has been minuscule and doesn't reflect any widespread hankering for a return of British rule. But, after 15 years as part of China, a population that is overwhelmingly Chinese and deeply proud of its Chinese heritage has increasingly come to view the rest of the country as a source of trouble, not pride, that needs to be kept at arm's length.

Britain's retreat from Hong Kong in 1997, which turned a crown colony into a special administrative region of China, marked a singular, triumphal moment in a historical narrative at the heart of the Communist party's legitimacy: only the party can "wipe clean the shame" of colonial-era humiliations and fully represent the national aspirations of all Chinese. Beijing used to denounce its critics and elsewhere as "anti-communist" but now vilifies them as "anti-China", an insult that turns any challenge to the ruling party into an assault on the Chinese nation.

In the years since it returned to Chinese rule, however, Hong Kong has repeatedly rejected Beijing's Communist party-dominated take on Chinese patriotism.

It cheers Chinese athletes at the Olympic Games, honours Chinese astronauts and holds a big firework display to celebrate China's National Day on 1 October, which was marred this year by a Hong Kong ferry crash in which at least 39 people died. But from protests by half a million people in 2003 over a proposed anti-subversion law demanded by Beijing to recent demonstrations against the introduction of patriotic education in schools, Hong Kongers – nearly all Chinese by blood, culture and language – have in large numbers defied Beijing's patriotic storyline of an ecstatic reunion of a long-divided family with a common identity.

"Of course, I'm Chinese. One hundred per cent Chinese," said Kenny Choi, a 23-year-old who works in a printing factory and took part in a recent protest that featured the waving of British colonial-era flags. "But I don't trust Chinese Communists ... Hong Kong is different and has to preserve its own values." Choi joined the rally, held at Sheung Shui railway station near a border crossing to mainland China, to express his anger over throngs of mainland traders who pour in each day to buy baby formula, cosmetics and other goods for resale back on the other side of the border.

The protest had an ugly, almost xenophobic tinge with crudely insulting placards demanding that mainlanders "go home" and "get lost". But it reflected a growing resentment in Hong Kong toward fellow Chinese from across the border.

The local media has bubbled recently with outrage over scuffles at a Hong Kong campsite allegedly provoked by rowdy, disruptive campers from the mainland and also reports that a mainland tourist beat up his female Hong Kong tour guide and then skipped town to avoid prosecution for assault.

So sour is the mood that even the ferry tragedy triggered a burst of anti-mainland sentiment after Li Gang, the deputy director of Beijing's representative office in Hong Kong, turned up at a hospital to offer condolences and give assurances of the "central government's concern". The visit, which upstaged Hong Kong's own leader, chief executive Leung Chun-ying, was widely derided in newspapers and online as an intrusive, communist-style ritual and an interference in Hong Kong's affairs. Beijing made matters worse by announcing that Chinese leaders had issued "important instructions" to Hong Kong's government on how to handle the disaster.

Hong Kong still largely runs its own affairs, with the exception of defence and foreign relations. Despite growing complaints of self-censorship by journalists, Hong Kong retains a boisterous free press and has developed a booming niche publishing industry that churns out books and magazines on Chinese politics, largely for sale to visiting mainlanders who don't believe China's tightly controlled official media.

Observers say Beijing interfered extensively in the selection earlier this year of Leung as chief executive by a 1,200-strong committee stacked with pro-Beijing plutocrats, but has since suffered setbacks in its efforts to rally public opinion behind its "patriotic" agenda. After an uproar, the Hong Kong government recently scrapped plans to make patriotism courses compulsory in all schools.

The economic, political and especially demographic forces bearing down on Hong Kong from across the border are still immense, a fact that has been brought home to ordinary residents here by a flood of visitors from the mainland. About 28 million mainlanders visited last year, which is four times Hong Kong's total population. In some shopping districts, Mandarin – a language many Hong Kongers don't speak – is now often heard as much or even more than Cantonese, the southern Chinese dialect that is the former colony's principal language.

Chin Wan-kan, an academic and the author of a widely discussed book that advocates Hong Kong becoming an independent city-state, said Hong Kong has no problem embracing China in the abstract, just not the mainland in its current form, which he described as "a mixture of rotten Chinese culture plus Soviet colonialism". Hong Kong, he said, is "definitely Chinese" but thanks to its long exposure to the west, represents "modern Chinese culture" rather than what he sees as a retrograde mainland variant.

A symptom of the malaise afflicting relations between Hong Kong and the rest of China is the voracious appetite of mainland mothers for Hong Kong's supplies of baby formula. Thanks to the rule of law and the scrutiny of a free press, Hong Kong shops almost never allow doctored food products on their shelves, in contrast to the mainland, which – due to endemic corruption and a near-total breakdown of trust – has seen a rash of sometimes fatal food scams.

Shops across the border stock the same brands of baby formula as Hong Kong, but many Chinese mothers assume they are fake and possibly dangerous. The resulting surge in demand for products smuggled in from Hong Kong has delighted Hong Kong merchants but infuriated residents in housing estates near the border who complain of rising prices and shortages.

Alarmed by recent protests in border towns, Hong Kong authorities have started cracking down on day-trip traders from the mainland, just as they earlier imposed tighter controls to prevent pregnant mainland women pouring in to give birth in the city's well-equipped hospitals.

The backlash against fellow Chinese from the mainland has been particularly strong among Hong Kong's young, who spearheaded the campaign against patriotic education and who, according to opinion polls, are most wary of local leaders and also meddling by Beijing.

Using Facebook and other social networking sites, a group of mostly young activists is working to rally support for the Hong Kong City-State Autonomy Movement. The group supports Chin's call for a city-state and uses as its logo a colonial crest of arms featuring a lion and dragon. But it insists it doesn't reject China, and only wants to resist the erosion of Hong Kong's own Chinese identity by "mainlandisation".

The group's views are far from mainstream and have no chance of ever being accepted by Beijing, which views Hong Kong's colonial past and all its emblems as a source of shame to be expunged, not celebrated.

During a recent debate with Chin, pro-Beijing businessman Lew Mon-hung sniffed at suggestions that Hong Kong should be an independent city-state as "theoretically ridiculous and practically dangerous". Hong Kong, he said, is "an inalienable part of China, whether you like it or not".

This article appeared in Guardian Weekly, which incorporates material from the Washington Post