The Thirteen Factories, also known as the Canton Factories, was a neighbourhood along the Pearl River in southwestern Guangzhou (Canton) in the Qing Empire from c. 1684 to 1856 around modern day Xiguan, in Guanzhou's Liwan District. These warehouses and stores were the principal and sole legal site of most Western trade with China from 1757 to 1842. The factories were destroyed by fire in 1822 by accident, in 1841 amid the First Opium War, and in 1856 at the onset of the Second Opium War. The factories' importance diminished after the opening of the treaty ports and the end of the Canton System under the terms of the 1842 Anglo-Chinese Treaty of Nanking. After the Second Opium War, the factories were not rebuilt at their former site south of Guangzhou's old walled city but moved, first to Henan Island across the Pearl River and then to Shamian Island south of Guangzhou's western suburbs. Their former site is now part of Guangzhou Cultural Park.