British Prime Minister Margaret Thatcher shakes hands with Chinese Premier Zhao Ziyang after signing the Sino-British Joint Declaration on December 19, 1984.

The secret negotiations that sealed Hong Kong's future

Updated 0652 GMT (1452 HKT) June 22, 2017

Hong Kong (CNN)The two leaders sat several feet apart at a long table covered in green silk.

Between them, a tiny twin flagpole bore the standards of the United Kingdom and the People's Republic of China.
The crowd behind applauded as British Prime Minister Margaret Thatcher and Chinese Premier Zhao Ziyang signed large red-bound documents with black fountain pens and then shook hands.
With that, on December 19, 1984, the end of more than 150 years of British rule over Hong Kong was sealed and a timeline put in place for China to assume sovereignty over the city on July 1, 1997.
The people of Hong Kong were not party to the discussions, nor were they consulted about the final decision, which had a profound effect on their futures and freedoms.
As early as 1982, establishing Hong Kong as a Chinese 'Special Administrative Region,' as it is today, was being discussed. Original image altered for clarity.

Treaty territory

The UK acquired the territory that is now China's Hong Kong Special Administrative Region via three treaties. Following the defeat of the Qing Empire in the first and second opium wars (in 1842 and 1860 respectively), the territories of Hong Kong and Kowloon were ceded to the UK.
In 1898, London agreed to lease what became known as the New Territories from the Qing, drastically expanding the amount of land governed by the Hong Kong colony, but also setting in motion the end of British rule.
While the Qing Empire -- and its successors, the Republic of China and the People's Republic of China -- had given up claims for Hong Kong and Kowloon, the lease for the New Territories was set to expire on 30 June 1997.
"We can only maintain sovereign powers in the New Territories up to 1997 in any case and the rest of the territory is not viable on its own," a 1982 UK Foreign Office memo warned Thatcher.