<human>:  When did Hong Kong become a British colony?
<bot>: Hong Kong was a British colony from 1842 to 1997. In 1842, the Treaty of Nanking was signed, which gave the British control over Hong Kong Island, Kowloon Peninsula, and the New Territories. In 1898, the Sino-British Joint Declaration was signed, which stated that Hong Kong would be leased to the United Kingdom for 99 years. In 1997, the British handed over Hong Kong to China.