British had arrested the Mughal Emperor in India, and invaded royal palaces in Java. In China the expedition led by Lord George, Earl Macartney (1737–1806) to Beijing in 1793 had inaugurated a long and increasingly problematic relationship with the European states, while the death of the Qian Long emperor in 1799 had undermined the legitimacy of the Qing dynasty more directly,