As part of the handover, a mini-constitution known as the Basic Law promised that Hong Kong would retain a high degree of autonomy for 50 years under a "one country, two systems" formula, with full democracy an "ultimate aim". But two decades later, there's no sign of that aim. China declined to make any concessions to student protesters demanding universal suffrage in "Occupy" street demonstrations in 2014. Frustration among democracy activists has simmered ever since.
IBTimes UK takes a look back at the territory's tumultuous times since 1997, with economic turmoil, outbreaks of deadly diseases and pro-democracy protests.
30 June 1997: Chris Patten, the 28th and last governor of colonial Hong Kong, receives the Union flag after it was lowered for the last time at Government House in Hong KongEmmanuel Dunand/AFP1 July 1997: The Chinese flag is raised by People's Liberation Army soldiers to signal Hong Kong's return to Chinese sovereignty after 156 years of British ruleDylan Martinez/Reuters1 July 1997: The last British troops, baggage in hand, depart the former HMS Tamar military base following the transfer of sovereignty over Hong Kong from British to Chinese ruleChou Yoon-Kong/AFP1 July 1997: Convoys of People's Liberation Army trucks and armoured vehicles enter the Wen Jingdu border crossing into Hong Kong at dawn after the territory returned to Chinese ruleManuel Ceneta/AFP28 December 1997: Chickens await their fate at a temporary wholesale poultry market at Cheung Sha Wan in Kowloon after inspectors declared the site to be infected with the deadly bird flu virus. Health officials began a mass cull of more than 1.2 million chickens and other poultry in a bid to stamp out the virus which had claimed the lives of four people in Hong KongTony Aw/AFP31 May 1998: For the first time under Chinese rule, thousands of protesters make their way down Hong Kong streets to commemorate the anniversary of the 1989 massacre of pro-democracy activists in Beijing's Tiananmen SquarePeter Parks/AFP10 October 2000: A man begs for change along an overpass as pedestrians walk by in Hong Kong, where the divide between rich and poor is widening. A Confederation of Trade Unions report showed about 370,000 households, or 1.24 million people, living in povertyFrederic J Brown/AFP22 May 2003: A mourner wears a mask to ward off the Sars virus while attending the funeral of Tse Yuen-man, a 35-year-old doctor who had volunteered to care for SARS patients. Hong Kong was the hardest hit by the flu-like Sars virus when the WHO declared a pandemic in March 2003. Some 299 people died before the territory was declared SARS free in June. Among them was TseBobby Yip/Reuters5 June 2003: A lone Western visitor wearing a surgical mask reads a book in a nearly empty Air China flight from Hong Kong to Beijing during an outbreak of Severe Acute Respiratory Syndrome (Sars)Natalie Behring-Chisholm/Getty Images1 July 2003: Thousands of people block the streets of Hong Kong in a huge protest march against a controversial anti-subversion law known as Article 23Peter Parks/AFP12 September 2005: Fireworks explode over the Sleeping Beauty Castle during the grand opening of the new Hong Kong DisneylandMN Chan/Getty Images17 December 2005: Anti-globalisation demonstrators are pepper-sprayed by riot police during a demonstration against the sixth World Trade Organisation (WTO) meeting in Hong KongJung Jeon-Ye/AFP20 June 2007: Elderly men are seen in their cage homes – steel mesh boxes barely large enough for a mattress, stacked in twos and threes – ahead of Hong Kong's 10th anniversary of the handover to Chinese rule. The gap between poor and rich in Hong Kong remains an unsolved problem in the international financial hub which boasts some of the richest people in the worldMN Chan/Getty Images30 June 2007: Chinese president Hu Jintao and Hong Kong chief executive Donald Tsang sing with performers and guests during the Grand Variety Show, part of a series of events celebrating the 10th anniversary of Hong Kong's handover to ChinaPaul Yeung/Reuters1 July 1997: Governor of China's Guangdong Province Huang Huahua, Chinese President Hu Jintao and Hong Kong Chief Executive Donald Tsang mark the 10th anniversary of the handover by officially opening the Shenzhen Bay Bridge, connecting Hong Kong and mainland ChinaAlex Hofford7 June 2008: Staff wearing protective gear cull chickens in a market in Hong Kong after the deadly H5N1 bird flu virus was found in samplesAndrew Ross/AFP27 September 2014: Occupy Central protesters clash with riot police on Connaught Road, one of the major highway in Hong Kong, in protest against Beijing interference in the political systemAnthony Kwan/Getty Images3 October 2014: Joshua Wong, leader of the student movement, delivers a speech to thousands of pro-democracy protesters in Hong KongTyrone Siu/Reuters17 October 2014: A local journalist collapses in agony after being hit in the face with pepper spray by police in the Mongkok district of Hong Kong as pro-democracy demonstrators attempted to take back a protest camp in a densely populated suburb that had been partially cleared by police earlier in the dayAlex Ogle/AFP26 November 2014: Police officers arrest Joshua Wong, student leader, as the Mong Kok protest site is scheduled for clearance and Hong Kong's high court authorised police to arrest protesters who obstruct bailiffsYam Lik Fei/Getty Images15 December 2014: Workers clear the last of three pro-democracy protest sites, marking the end of demonstration camps in the city that had blocked streets for more than two monthsTyrone Siu/Reuters17 November 2015: Hong Kong fans hold banners that read 'Hong Kong is not China', during the 2018 World Cup qualifying match between Hong Kong and China, in Hong KongBobby Yip/Reuters12 October 2016: Newly elected representative Yau Wai-ching displays a protest banner before taking oath at the Legislative Council in Hong KongBobby Yip/Reuters2 November 2016: Newly-elected pro-independence politician Baggio Leung is restrained by security after he and Yau Wai-ching entered the Legislative Council despite being banned from doing so, pending the result of a judicial review into whether they can take up their seatsAnthony Wallace/AFP6 November 2016: Police stop demonstrators protesting against what they call Beijing's interference into local politics a day before China's parliament was due to announce their interpretation of the Basic Law in light of two pro-independence politicians' oath-taking controversy in Hong KongTyrone Siu/Reuters7 November 2016: A police officer yells instructions during a protest as China effectively barred two elected pro-independence politicians from Hong Kong's legislature for deliberately misreading their oathsIsaac Lawrence/AFP12 May 2017: A plaque is partly hidden between the roots of a banyan tree at the King George V Memorial Park in Hong Kong, one of the few parks bearing former links to the territory's colonial pastBobby Yip/Reuters4 June 2017: Members of the public hold a candlelit vigil in Hong Kong to mark the 28th anniversary of the 1989 Tiananmen Square massacre in BeijingIsaac Lawrence/AFP27 June 2017: Chinese and Hong Kong flags are seen ahead of Chinese President Xi Jinping's arrival in Hong Kong for the 20th anniversary of the handover from Britain to ChinaBilly HC Kwok/Getty Images28 June 2017: Ahead of Xi Jinping's visit, Joshua Wong and other pro-democracy demonstrators hold a banner that reads 'Free Liu Xiabo! Free all political prisoners! Universal suffrage now!' as they stand on Hong Kong's iconic Golden Bauhinia statue which was given to Hong Kong by China to mark the 1997 handoverAnthony Wallace/AFP28 June 2017: Pro-democracy campaigner Joshua Wong yells as he is taken away by police after he and other demonstrators staged a sit-in protest at the Golden Bauhinia statue ahead of a visit by Chinese President Xi JinpingAnthony Wallace/AFP29 June 2017: China's President Xi Jinping waits to meet with Hong Kong's chief executive Leung Chun-ying at a hotel in Hong Kong. Xi is in Hong Kong to mark the 20th anniversary of the city's handover from British to Chinese rule and to inaugurate new chief executive Carrie LamDale de la Rey
Chinese President Xi Jinping is due to attend anniversary events in coming days, including new Chief Executive-elect Carrie Lam's swearing into office on Saturday as the city's first female leader. Lam, 60, is the territory's fourth leader since it reverted to Chinese rule in 1997.