Disputing the view that Shanghai was little more than a fishing village before becoming a treaty port in 1843, this book shows that Shanghai had already become a major commercial port many years earlier. The author traces the growth of Shanghai from market town in the Song dynasty to a centre of cotton production in the Ming dynasty and a port city under the Qing. Drawing on diverse Chinese sources, she stresses continuities in the city's history and situates the Westerners' arrival in the context of Chinese institutions, policies, and commerce. In the eighteenth and early nineteenth centuries, merchants from other parts of China flocked to Shanghai because of expanding trade. The book details the activities of these merchant groups. It takes a fresh look at the first years of the Western presence and shows how officials manoeuvred the foreigners into helping expel rebels from Shanghai and collecting tariffs.