Chinese immigrants, primarily men, first came to Vancouver in large numbers during the late 19th century, attracted in part by the British Columbia gold rush of 1858 and then the construction of the Canadian Pacific Railway in the 1880s. In the census of 1880–81, the total Chinese population in Canada was 4,383, of which the overwhelming majority (4,350) resided in British Columbia. By 1884, 17,000 Chinese immigrants had arrived in Canada to work on the railroad alone. The 1891 census counted 9,129 Chinese in Canada (8,910 in British Columbia), and the population at the 1901 census had increased to 16,792 in Canada (14,376 in British Columbia as an incomplete count). Of the estimated 16,000 Chinese immigrants in British Columbia in 1901, 2,715 lived in Victoria and another 2,011 lived in Vancouver.