The Sino-American Treaty of Wanghia was signed in July 1844 by Chinese Qing government official Qiying, the Viceroy of Liangguang, who held responsibility for the provinces of Guangdong and Guangxi, and Massachusetts politician Caleb Cushing (1800–1879), who was dispatched with orders to "save the Chinese from the condition of being an exclusive monopoly in the hands of England" as a consequence of the 1842 Nanking treaty. Under the Treaty of Wanghia, Americans gained the same rights as those enjoyed by the British in China's treaty ports. It also contained a clause that effectively carved out Shanghai as an extraterritorial zone within Imperial China, though it did not actually give the American government a true legal concession.