In September 1982 she visited China to discuss with Deng Xiaoping the sovereignty of Hong Kong after 1997. China was the first communist state Thatcher had visited and she was the first British prime minister to visit China. Throughout their meeting, she sought the PRC's agreement to a continued British presence in the territory. Deng insisted that the PRC's sovereignty on Hong Kong was non-negotiable, but stated his willingness to settle the sovereignty issue with the British government through formal negotiations, and both governments promised to maintain Hong Kong's stability and prosperity. After the two-year negotiations, Thatcher conceded to the PRC government and signed the Sino-British Joint Declaration in Beijing in 1984, agreeing to hand over Hong Kong's sovereignty in 1997.