Upon the confederation of Canada on July 1, 1867, Sir John A. Macdonald (1815-1891) became Canada's first prime minister. His government completed construction of the transcontinental Canadian Pacific Railway in 1885. Before Macdonald became prime minister, his Toronto residence and office were often at the Queen's Hotel, now the site of the Royal York Hotel.