Japan built the first factories in Shanghai, which were soon followed by other foreign powers. The Chinese defeat also spurred reformers within the Qing government to modernize more quickly, leading to the reëstablishment of the Songhu Railway and its expansion into the Shanghai–Nanjing Railway. Republic of China The 1911 Xinhai Revolution, spurred in part by actions against the native-owned railways around Shanghai, led to the establishment of the Republic of China. During that time, Shanghai became the focal point of many activities that would eventually shape modern China. In 1936, Shanghai was one of the largest cities in the world with 3 million inhabitants. Of those, only 35,000-50,000 were of European origin, but these controlled half the city under the unequal treaties that provided extraterritoriality until 1943. Many White Russians fled to China after the 1917 Russian Revolution, trickling to Shanghai along the 1920s. The number of people with Russian origins was about 35,000 by the 1930s, well exceeding number of other people with European origin. These Shanghai Russians were sometimes poorly regarded by westerners, as their general poverty led them to take jobs considered unsuitable for Europeans, including prostitution. However, among Russian emigration was layered, also including several well-to-do members. Russian artists dominated Shanghai's artistic life almost single-handedly. Many Jewish refugees from Nazi Germany arrived in the 1930s. The city was thus divided between its more European western half and the more traditionally Chinese eastern half. New inventions like electricity and trams were quickly introduced, and Westerners helped transform Shanghai into a metropolis. British and American businessmen made a great deal of money in trade and finance, and Germans used Shanghai as a base for investing in China. Shanghai accounted for half of the imports and exports of China. The western part of Shanghai grew to a size four times larger than the Chinese part had been in the early 20th century. European and American inhabitants of Shanghai called themselves the Shanghailanders. After problems during its initial few years, the Public Garden north of the BundChina's first public park and today's Huangpu Parkwas for decades reserved for the foreign nationals and forbidden to Chinese natives. The International Settlement was built in the British style with a large racetrack at the site of today's People's Square. A new class emerged, the compradors, which mixed with the local landlords to form a new class, a Chinese bourgeoisie. The compradors were indispensable