Before 1949, people could move freely into and out of Hong Kong (then a British colony), and China (then Republic of China). Hong Kong residents who held Republic of China citizenship were not registered. In 1949, when the Government of the Republic of China retreated to Taiwan and the :People's Republic of China was established on the mainland, the Hong Kong Government began to register Hong Kong residents to issue compulsory identity documents. These measures were put into practice to halt the large influx of refugees from Communist China and control the border with mainland China. The registration was completed in 1951. Although registration was compulsory for all residents, people were not required to carry their documents with them at all times when out in public.