Following several constitutional conferences, the British North America Act brought about Confederation creating "one dominion under the name of Canada" on July 1, 1867 with four provinces: Ontario, Quebec, Nova Scotia, and New Brunswick. Canada assumed control of Rupert's Land and the North-Western Territory to form the Northwest Territories. Métis' grievances ignited the Red River Rebellion and the creation of the province of Manitoba in July 1870. British Columbia and Vancouver Island (which had united in 1866) and the colony of Prince Edward Island joined Confederation in 1871 and 1873, respectively. Prime Minister John A. Macdonald's Conservative Party established a National Policy of tariffs to protect nascent Canadian manufacturing industries. To open the West, the government sponsored construction of three trans-continental railways (most notably the Canadian Pacific Railway), opened the prairies to settlement with the Dominion Lands Act, and established the North West Mounted Police to assert its authority over this territory. In 1898, after the Klondike Gold Rush in the Northwest Territories, the Canadian government decided to create the Yukon territory as a separate territory in the region to better control the situation. Under Liberal Prime Minister Wilfrid Laurier, continental European immigrants settled the prairies, and Alberta and Saskatchewan became provinces in 1905.
Canada automatically entered the First World War in 1914 with Britain's declaration of war, sending volunteers to the Western Front. The Conscription Crisis of 1917 erupted when conservative Prime Minister Robert Borden brought in compulsory military service over the objection of French-speaking Quebecers. In 1919, Canada joined the League of Nations independently of Britain; in 1931 the Statute of Westminster affirmed Canada's independence.
The Great Depression of 1929 brought economic hardship to all of Canada. In response, the Co-operative Commonwealth Federation (CCF) in Alberta and Saskatchewan presaged a welfare state as pioneered by Tommy Douglas in the 1940s and 1950s. Canada declared war on Germany independently during World War II under Liberal Prime Minister William Lyon Mackenzie King, three days after Britain. The first Canadian Army units arrived in Britain in December 1939.The economy boomed as industry manufactured military materiel for Canada, Britain, China and the Soviet Union. Despite another Conscription Crisis in Quebec, Canada finished the war with one of the largest militaries in the world. During the Second World War, Canada was the first Allied nation to attempt to gain a foothold on Axis occupied Europe in 1942 during the failed Dieppe Raid, Canada played a major role in the Battle of the Atlantic, took a major role in the invasion of Italy, and was responsible for the liberation of the Netherlands from German occupying forces in 1945.
In 1949, Newfoundland joined Confederation as Canada's 10th province. Post-war prosperity and economic expansion ignited a baby boom and attracted immigration from war-ravaged European countries.
Quebec underwent profound social and economic changes during the Quiet Revolution of the 1960s. Québécois nationalists began pressing for greater provincial autonomy. The separatist Parti Québécois first came to power in 1976. A referendum on sovereignty-association in 1980 was rejected by a solid majority of the population, and a second referendum in 1995 was rejected by a slimmer margin of just 50.6% to 49.4%. In 1997, the Canadian Supreme Court ruled unilateral secession by a province to be unconstitutional; Quebec's sovereignty movement has continued nonetheless.
Under successive Liberal governments of Lester B. Pearson and Pierre Trudeau, a new Canadian identity emerged. Canada adopted its current Maple Leaf Flag in 1965. In response to a more assertive French-speaking Quebec, the federal government became officially bilingual with the Official Languages Act of 1969. Non-discriminatory Immigration Acts were introduced in 1967 and 1976, and official multiculturalism in 1971; waves of non-European immigration have changed the face of the country. Social democratic programs such as Universal Health Care, the Canada Pension Plan, and Canada Student Loans were initiated in the 1960s and consolidated in the 1970s; provincial governments, particularly Quebec, fought these as incursions into their jurisdictions. Finally, Prime Minister Pierre Trudeau pushed through the patriation of the constitution from Britain, enshrining a Charter of Rights and Freedoms based on individual rights in the Constitution Act of 1982.
Economic integration with the United States has increased significantly since World War II. The Canada-United States Automotive Agreement (or Auto Pact) in 1965 and the Canada-United States Free Trade Agreement of 1987 were defining moments in integrating the two economies. Canadian nationalists continued to worry about their cultural autonomy as American television shows, movies and corporations became omnipresent. However, Canadians take special pride in their system of universal health care and their commitment to multiculturalism.