From the History Website:
"On July 1, 1867, with passage of the British North America Act, the Dominion of Canada was officially established as a self-governing entity within the British Empire. Two years later, Canada acquired the vast possessions of the Hudson’s Bay Company, and within a decade the provinces of Manitoba and Prince Edward Island had joined the Canadian federation. In 1885, the Canadian Pacific Railway was completed, making mass settlement across the vast territory of Canada possible."