and Weihaiwei to the United Kingdom, Guangzhouwan to France, Kwantung Leased Territory and Taiwan to the Empire of Japan, the Jiaozhou Bay concession to the German Empire and concession territory in Tientsin, Shamian, Hankou, Shanghai etc.), and make various other concessions of sovereignty to foreign spheres of influence, following military threats. The earliest treaty later referred to as "unequal" was the 1841 Convention of Chuenpi negotiations during the First Opium War. The first treaty between China and the United Kingdom termed "unequal" was the Treaty of Nanjing in 1842. Following Qing China's defeat, treaties with Britain opened up five ports to foreign trade, while also allowing foreign missionaries, at least in theory, to reside within China. Foreign residents in the port cities were afforded trials by their own consular authorities rather than the Chinese legal system, a concept termed extraterritoriality. Under the treaties, the UK and the US established the British Supreme Court for China and Japan and United States Court for China in Shanghai. Chinese resentment After World War I, patriotic consciousness in China focused on the treaties, which now became widely known as "unequal treaties". The Nationalist Party and the Communist Party competed to convince the public that their approach would be more effective. Germany was forced to terminate its rights, the Soviet Union surrendered them, and the United States organized the Washington Conference to negotiate them. After Chiang Kai-shek declared a new national government in 1927, the Western powers quickly offered diplomatic recognition, arousing anxiety in Japan. The new government declared to the Great Powers that China had been exploited for decades under unequal treaties, and that the time for such treaties was over, demanding they renegotiate all of them on equal terms. Towards the end of the unequal treaties After the Boxer Rebellion and the signing of the Anglo-Japanese Alliance of 1902, Germany started to reassess the policy approach towards China. In 1907 Germany suggested a German-Chinese-American agreement that never materialised. Thus China entered the new era of ending unequal treaties on March 14, 1917 when it broke off diplomatic relations with Germany. China declared war on Germany on August 17 1917. These acts voided the unequal treaty of 1861, resulting in the reinstatement of Chinese control on the concessions of Tianjin and Hankou to China. In 1919, China refused to sign the Peace Treaty of Versailles. On May 20, 1921, China secured with the German-Chinese