The Thirteen Factories, also known as the , was a neighbourhood along the Pearl River in southwestern Guangzhou (Canton) in the Qing Empire from to 1856 around modern day Xiguan, in Guangzhou'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 . Terminology The "factories" were not workshops or manufacturing centres but the offices, trading posts, and warehouses of foreign factors, mercantile fiduciaries who bought and sold goods on consignment for their principals. The word derives from “feitoria” which means trading post in Portuguese (the first westerners to engage in trade with China). The foreign agents were known at the time as "supercargos" in English and as daban () in Chinese. This term's Cantonese pronunciation, tai-pan, only came into common English use after the rise of private trading from 1834 on. A private captain might be his own supercargo; a large East Indiamen might have five or more, which were ranked "chief supercargo", "2nd supercargo", and so on. A team of supercargos divided their work, some overseeing sales, others tea purchases, silk purchases, and so forth. Permanent supercargos might divide their work by the order ships arrived. The bookkeepers who attended them were called "writers"; those serving with the ship, who also checked these accounts, "pursers". "Hong" is the Cantonese pronunciation of , the Chinese term for a properly-licensed business. By analogy, it was applied to its chief, the Hong merchant, and its property, the factories themselves. It has also been suggested the term was first applied to the factories as they were arranged in a row along the riverbank, "row" or "rank" being an alternative meaning of the same Chinese character. Hoppo, or fully the "Canton Sea Customs Minister", was the imperial