A nail house in Shanghai. As prime land becomes more valuable, the pressure to replace old housing grows stronger. Photograph: Sue Anne Tay for the Guardian

The familiar melodic strains could be heard a block away. Walking closer, the chorus swept into a rousing crescendo:

The Communist party is like the sun / Wherever it shines, it is bright / Wherever the Communist party is / Hurrah, there the people are liberated!

East Is Red, the anthem of China's tumultuous Cultural Revolution, was being piped out of the second-storey window of an old house located a few streets south of Xintiandi, Shanghai's affluent downtown shopping district. The house was part of an old neighbourhood that was being demolished to accommodate the next phase of high-end real estate expansion.

But it was the slogans on the two banners hung outside the house which really caught the attention of the crowd gathered across the street. Angry over the pending loss of his home, one resident had scrawled "democracy begins with rights" on one banner – and launched a nostalgic call back to Maoism on the other: "Chairman Mao, the people miss you! Corrupt officials are scared of you!"

Shanghai, long regarded as the beating heart of capitalism in China, has built more than 400 skyscrapers since 1990, outpacing New York and Tokyo. As land in prime areas becomes scarcer and more valuable, the pressure to replace old public housing – an east-west hybrid of brick row houses built during the first half of the 20th century – with towering commercial properties and luxury apartments grows exponentially.

The process of demolishing an old neighbourhood can take several years from notification to the first swing of the wrecking ball. Local district officials hire relocation companies to negotiate with residents to arrive at acceptable compensation, which can be used to acquire alternative new housing in distant suburbs. Surrounded by the daily reminder of the gulf between rich and poor in Shanghai, where Louis Vuitton stores and Ferraris are common, residents lament that the compensation they receive is paltry.

Among the older generation, many retired on modest pensions or running small businesses, a handful have resorted to open protest about being short-changed, refusing to vacate their premises even as neighbouring houses begin to be taken apart. Eventually, their homes become lone structures, like small boats in a sea of rubble. The local media coined the term "nail houses", similar to obtrusive nails that are stuck and irremovable in wood – or, as some citizens point out darkly, to be pounded into submission with a hammer.

Intimidation and forced evictions of nail-house residents by hired thugs or employees of demolition companies are not uncommon. Sometimes they even result in deaths. A few years ago, the central government passed laws prohibiting the use of violence in the housing relocation process; in larger cities like Shanghai, residents who are more likely to be well-versed in their constitutional rights have involved the police and courts to guard against any unlawful action. But intimidation and forced seizure are frequently reported.

The issue of relocation is complex, and the choice to protest is sometimes frowned upon by surrounding neighbours who have been bought out. There is a clear generational divide over how residents feel about relocating homes. Younger Shanghainese tend to be more eager to upgrade from crumbling stairs, poorly lit communal kitchens and public toilets for more spacious and modern apartments in fresh-aired suburbs. The older generation, having adapted to decades of cramped living conditions and the convenience of nearby hospitals and parks, are more reticent about leaving the tight-knit communities they grew up in.

Taking a stand

All afternoon, crowds came and went as a repertoire of old Communist party songs played on a loop from the old house. A man in his 50s shrugged when asked how long the homeowner had been protesting, as if inured to such developments. "Weeks now, months … maybe a year? This isn’t the only nail house in the neighbourhood."

An old man in a Mao cap, who had relocated from this area to the eastern suburbs a year earlier, told me he still returned weekly to his old local barbershop to chat with his former neighbours. Pointing to the banners, he said: “Ordinary people like us will never prevail against the [real estate] developers. These residents take a stand to make a point, but in the end they inevitably have to accept reality and move on.”

His words captured the common dilemma of Shanghai’s lower urban classes, left behind during Shanghai’s boom years. They are stuck living around a modern city they cannot afford and which them out of the way.

Some older Shanghainese are reluctant to leave the cramped but well-connected inner city areas they grew up in. Photograph: Sue Anne Tay

These people are proud of Shanghai’s ascendance as a global cosmopolitan city, yet simultaneously feel undone by the acute cost of living, their limited salaries and pensions, and insecurity over their property. The city’s prosperity was supposed to lift all boats, but instead they feel left behind.

To cope with neglect and injustice, some of Shanghai’s older generation are harking back to old symbols of authority to remind people of the party’s once-utopian roots of class equality, social harmony and corruption-free society as championed by the Great Helmsman himself, Mao Zedong. The death and violence caused by the Cultural Revolution is a blind spot; instead, these residents focus on the nostalgia of what they believe to be fairer and better days from socialism’s past.

Caught in the shifting sands of Chinese megacity development, no one, it seems, is speaking out for Shanghai’s urban poor as they are removed from their homes and priced out to distant corners they never imagined visiting, much less living in. Their call for Mao feels not so much like a genuine cry for history, but for the sense of loss of a community lifestyle – and the city they call home.