While Shanghai has been around as a village since the Song Dynasty, a thousand years or so ago, it only rose to prominence after China lost the First Opium War in 1842. Shanghai was one of five cities which were opened to trade as treaty Ports. Shanghai grew amazingly after that; until then nearby cities like Hangzhou, Suzhou and Nanjing had been far more important, but today Shanghai is definitely the focus of the region.
Eight nations — Germany, France, Italy, Russia, Austria-Hungary, Japan, the United States and the United Kingdom — were granted concessions in Shanghai, areas that they controlled and where Chinese law did not apply. Most of these were jointly administered as the "International Settlement", but the French ran theirs separately. In all of them, the population was mainly Chinese, of course, but the legal system was foreign and the police included many Sikhs and French gendarmes. They were located North of the Chinese city. Today all these areas are considered parts of downtown Shanghai.