When George Balfour, the first appointed British consul of Shanghai, envisaged the future of his British-only settlement at the end of 1843, he stood on a piece of marshland by the Huangpu River.

Balfour could not have imagined in his wildest dreams the prosperous modern metropolis to come. The settlement was to be built, first and foremost, to house an influx of refugees from the Chinese hinterland.

Balfour’s master plan was neither visionary nor inspirational; it was a rudimentary division of land blocks driven by sheer pragmatism. East-west roads were laid towards the Huangpu River bank, which has lasted to this day as the enduring urban feature of Shanghai – the Bund.

The early buildings in the British settlement – consulates, trade offices and houses, sitting oddly on the muddy ground to the Chinese eye – were not meant to last. The settlers slept rough. Hoping to make a quick fortune in Shanghai, they did not intend to stay put for long.

This piece of “wasteland” of one-kilometre-long river frontage with easy waterways connecting to the vast interior turned out to be the most convenient and indeed strategic location for the British. The French too quickly saw the advantage. In 1856 they secured the segment between the old Shanghai town and the British Bund as the French Bund, though not as grand.

A haven in times of conflict

A remarkable population boom and prosperity occurred in the second decade of foreign settlement when droves of Chinese refugees sought sojourn in the safe haven of foreign concession lands.

During years of turmoil, which started with the threat of the Small Sword Society in the old Shanghai town and continued until the collapse of Taiping Tianguo in 1864, the British Shanghai was never taken. More than 30 million people lost their lives during the 14 years of revolution and rebellion.

It was against this background that the Chinese refugees flocked to the foreign settlements. By 1865, the population in Shanghai’s foreign concession had reached 1,50,000. This was 21.5% of the entire population in Shanghai and included approximately 1,10,000 Chinese.

Although foreign merchants were predominantly involved in trading (opium, silk, cotton and tea), building houses and letting them to the Chinese refugees proved to be far more profitable than what they originally set out to do.

An English merchant declared his naked business ambition to Balfour’s successor as British consul, Rutherford Alcock. With a profit margin of 30-40% in this property development business, he showed zero concern for Shanghai’s future:

In two or three years at farthest, I hope to realise a fortune and get away; what can it matter to me, if all Shanghai disappears afterwards, in fire or flood?

This was the first time in Chinese history that the notion of profit-driven property development was explicitly displayed before the Chinese. The segregation of Chinese and foreigners as determined by land regulations was broken. The consuls of Britain, America and France subsequently revised these without any consultation with the Qing Court.

Rise of a modern metropolis

The influx of people into the foreign settlements also enabled the inevitable transition of economic structure – that is, the shift from a primarily trade-driven one to that of production and industry.

In addition to the building industry, reeling mills, yarn and flour factories emerged on the banks of the Huangpu River and Suzhou Creek. These provided a vital force that pushed the unskilled farmers from the hinterland into various trades – a marker of the rapid urbanisation and modernisation of Shanghai.

The early houses were makeshift timber terraces built in shanty construction, which were known as li (the ancient name of neighbourhood). But the governments of foreign settlement abolished this sort of construction after 1870, mainly because it was prone to fire.

From then on, the mixed construction of timber and masonry called shiku men (stone gate building) had gradually replaced the early makeshift timber terraces as the dominant residential pattern and urban form of modern Shanghai.

Better built and more costly than the earlier timber houses, the parsimony of their land use meant dwellings were clustered together like the English terrace house, one next to the other within the parallel urban grids of the streets and laneways. Being low maintenance and high rent, the shiku men housing became very popular in Shanghai.

This form of housing quickly spread over the old Shanghai town and other places occupied only by the Chinese. The country gentry and land owners had their first taste of modern urban life when they stayed in these houses. They were small, confined, dark and poorly ventilated.

The Confucian world of paterfamilias, though tenuously held by the hall and symmetry of the old shiku men, begun to be shaken by the distraction and allure offered by the larger interior of the city.

The extension of confined shiku men to the laneways and street led to the world of delicious and exotic food, intoxicating drinks, shops selling fine things, sleazy opium dens and brothels, splendid dancing halls holding elegant balls, racetracks and casinos. All were irresistible.

The porosity between the house and street became the precursor of a lively urban life. It exuded the glitter of the city as the replacement of the internalised Confucian world – the courtyard. “Shanghai petty urbanites”, coined by one of Shanghai’s favourite literary daughters, the exceedingly talented Eileen Chang, are symbiotic with this urban fabric that houses them.

Shanghai could hardly be recognised as a Chinese city. But Chang laid bare her affection for the intoxicated city and its residents:

Shanghai people are distilled from traditional Chinese people under the pressure of modern life; they are the product of a deformed mix of old and new culture. The result may not be healthy, but in it there is also a curious wisdom.

Rooted in its inception as an asylum haven, one aspect of this “curious wisdom” appears to be xenophilia. It is telling that, unlike xenophobia, this word is a modern coinage.

Modern Shanghai was soon more globalised than today’s European Union – no-one needed a passport, let alone a visa, to enter Shanghai. That some 20,000 Jewish refugees were embraced in Shanghai during the second world war was another example of the innate character of this modern metropolis.

Such magnanimous urbanity has arguably continued to this day. As the popular saying goes, Shanghai is the sea where all rivers run into it.

Xing Ruan, Professor of Architecture, Associate Dean International and Director of Architecture, UNSW Australia

This article first appeared on The Conversation.