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.

A declassified secret document prepared for newly elected British Prime Minister Margaret Thatcher in June 1979 warns of the upcoming issue of the lease to Hong Kong's New Territories. Original image altered for clarity.

In his memoirs , David Akers-Jones -- chief secretary of Hong Kong from 1985 to 1987 -- wrote that following the war and the gradual collapse of the British Empire, "Hong Kong recognized that the uncertain future would last until it was known what would happen when the lease of most of the colony, the New Territories, expired."

That future would not include independence , as it did for most other British colonies. After the People's Republic of China joined the United Nations in 1971, Beijing successfully pushed for Hong Kong (along with neighboring Macau, then a Portuguese colony) to be removed from a list of " non-self-governing " territories for whom all steps were to be taken by the UN "to enable them to enjoy complete independence and freedom."

At the start of negotiations between the UK and China over Hong Kong, London hoped to be able to maintain British administration over the former colony. Original image altered for clarity.

Secret talks

In 1982, Thatcher visited Beijing, becoming the first UK Prime Minister to enter Communist China, and formally established negotiations on the future of Hong Kong.

Initially, London hoped to maintain significant control over the city, even if it ceded legal sovereignty to China.

In secret discussions among Thatcher's cabinet -- since declassified -- it was suggested land leases in the New Territories could be converted to indefinite ones in order to "make it possible for British administration to continue beyond 1997 if the Chinese so wish."

That proposal was rejected by Beijing as "unnecessary and inappropriate" in what British ambassador to China Sir Percy Cradock described in a September 1979 memo as a "disappointing reply."

Before negotiations over Hong Kong began in earnest, Thatcher said she was "disturbed" by Chinese insistence on asserting sovereignty over the city. Original image altered for clarity.

As Thatcher prepared to visit Beijing three years later, a briefing document prepared for her said "there will be strong expectations that Hong Kong's future will be discussed, if not decided" during her time there.

Despite this however, UK Foreign Ministry officials were still operating on the basis that British administration, if not rule, would continue. "Confidence in the territory, particularly among investors, is likely only to be maintained if autonomy is guaranteed by the administration continuing on the same lines, i.e. through the British," a March 1982 memo said.

British law requires most cabinet documents to be declassified 20-30 years after they were initially created . While the documents do quote Chinese officials extensively, few accounts of Beijing's side of the negotiations have been made public.

Chinese paramount leader Deng Xiaoping warned British Prime Minister Margaret Thatcher in September 1982 Beijing was becoming impatient over the unresolved issue of Hong Kong's future. Original image altered for clarity.

Prosperity vs stability

By April 1982, the future legality of Hong Kong was starting to come into place.

In a meeting between former British Prime Minister Edward Heath and Chinese paramount leader Deng Xiaoping, Deng said that a new Chinese constitution would "specifically allow for the creation of special administrative zones," where different legal and economic systems could operate.

"Heath said that Britain received nothing from Hong Kong and suggested that Britain managed Hong Kong for the benefit of China and of mankind," Cradock wrote in a secret memo to Thatcher.

Around this time, Deng put forward the principle that now governs Hong Kong, of "one country, two systems," by which the city would retain its "capitalist" economy and limited democratic freedoms, but sovereignty would pass to Beijing.

Early in the negotiations, advisers to Thatcher suggested the UK make concessions over its sovereignty claims to Hong Kong. Original image altered for clarity.

On September 23, 1982, Thatcher met with Zhao Ziyang at the Great Hall of the People. "(Zhao) said that there were two principles (at stake) -- sovereignty, and the prosperity and stability of Hong Kong," a record of the meeting said. "If it came to a choice between the two, China would put sovereignty above prosperity and stability."

The following day, Thatcher met with Deng, during which the old revolutionary warned her "in no more than one or two years time the Chinese government would formally announce their decision to recover Hong Kong."

Talks continued after Thatcher left Beijing, and would eventually result in the Sino-British Joint Declaration that she and Zhao signed on that day in 1984.

Thatcher and Chinese paramount leader Deng Xiaoping in Beijing's Great Hall of the People in September 1982.

No consultation

Throughout the discussions held by Thatcher's cabinet, the chief concerns expressed in the secret memos were retaining market "confidence" in Hong Kong, and avoiding a situation like the Falklands, over which Britain went to war with Argentina in 1982.

Emily Lau, former chairwoman of the Hong Kong Democratic Party, said Hong Kongers knew that "all (the British) cared about was trade ... and the well being of the Hong Kong people was of secondary importance."

She too pointed to the Falklands, but to make a very different point. "There were only 1,800 people and hundreds of thousands of sheep" on the islands, Lau said, but nevertheless the Falklanders were given a seat at the table in negotiations between the UK and Argentina during the 1970s, before the failed Argentine invasion of 1982.

By comparison, Hong Kongers "could not play any part" in handover talks, though they were involved after the deal was done in drafting the city's mini-constitution, Basic Law

In talks over Hong Kong's future, Thatcher suggested the city would be represented by its Governor, an unelected colonial official. Original image altered for clarity.

"The British and Chinese governments had already jointly decided to impose their agreement on the territory and were not willing to make amendments to it," according to historian Ian Scott . Last ditch efforts in 1983 of Hong Kong legislators to represent the views of the city -- which largely did not favor rule by China -- "were fruitless."

While Hong Kongers were invited to publicly comment on the negotiations, the secret nature of them made doing so nigh impossible.

"Both the Chinese and British governments have openly invited the people of Hong Kong to express their views," lawmaker Wong Lam said in a session of the city's parliament in March 1984 . "Yet how can they express their views if they have very little or no knowledge of what is going on?"

British soldiers lower the country's flag for the last time at the Cenotaph monument in central Hong Kong on June 30, 1997.

Push and pull

The treatment of Hong Kongers during the negotiations has left a great deal of residual anger towards the British from parts of the city's pro-democracy movement.

"I think the British have a lot to answer for," Lau said. "(Both in) not giving us democratic elections, and not allowing Hong Kong British citizens to go and live in the UK. We were third class citizens."

After signing the treaty, Thatcher visited Hong Kong, where Lau, a journalist at the time, accused her of delivering "over five million people into the hands of a Communist dictatorship."

Thatcher responded that Britain had "done everything we could for Hong Kong," adding that Lau was likely the only person in the city unhappy with the deal.

This composite image of a memo sent to British Prime Minister Harold MacMillan in 1958 recounts how Chinese Premier Zhou Enlai warned against any attempts to democratize Hong Kong. Original image altered for clarity.

Declassified documents from long before handover negotiations even began show that some British officials did seek to introduce more democracy in Hong Kong but were angrily rebuffed by Beijing.

Allowing Hong Kong people to govern themselves would be a "very unfriendly act," premier Zhou Enlai reportedly told British officials in 1958. Another Chinese official in 1960 threatened potential invasion if the UK attempted to introduce greater democracy to the colony.

Directly elected lawmakers addressed a crowd from a balcony of the city's parliament on July 1, 1997. The flames of democracy, they promised, would never be "snuffed out."

On July 1, 1997, after Patten sailed away on the yacht Britannia, the elected legislators sneaked onto the balcony of the city's parliament building. Speaking to a large crowd below , Democratic Party Chairman Martin Lee and his colleagues promised the crowd they would return.

"The flame of democracy has been ignited and is burning in the hearts of our people," he said. "It will not be extinguished."