Updated on October 20 at 6:45 a.m. ET

Canada’s Liberal Party swept into power for the first time in nine years Monday night, ousting the Conservative government in a dramatic upset in the country’s parliamentary elections.

The centrist Liberals won 184 of the 338 seats in the next House of Commons, a bigger-than-expected rout of its rivals. Harper’s Conservatives had 99, and Tom Mulcair’s left-leaning New Democratic Party 44.

“This is what positive politics can do,” Trudeau told supporters at a victory rally late Monday night. The prime minister-designate struck an upbeat, inclusive tone as he made his first speech since the election results. “My message to you tonight, my fellow citizens, is simple: Have faith in yourself and in your country.”

The surprising result caps off eleven weeks of campaigning, an unusually long period for Canadian elections. When the previous Canadian parliament dissolved on August 2, the Conservatives held power with a 159-seat majority government, the NDP held 95 seats as the official opposition, and the Liberals held 36 seats, with smaller parties holding another six seats in the Commons. By midnight on Monday, the Canadian Broadcasting Corporation projected 190 Liberal seats, 103 Conservative seats, 34 NDP seats, and another 11 seats for smaller parties for the next Commons. Early polls had forecast a narrow race between the Conservatives and the New Democrats, but the New Democrats steadily lost ground after their initial surge and the Liberal Party saw a gradual increase in support over the last two weeks.

Harper, who led Conservative governments after three successive elections over the past decade, will remain in parliament but step down as the leader of his party. His legacy, like his tenure, will be deeply controversial. Canada is internationally renowned for its open society and liberal political culture, both of which Harper clashed with throughout his political career. In August, Canadian novelist Stephen Marche condemned him for “creating a legacy of secrecy and ignorance” in a widely shared op-ed in The New York Times.

As election day neared, Harper and his party turned to dog-whistle politics and increasingly hostile rhetoric toward Canadian Muslims to retain power. A key issue in the campaign’s final weeks centered around the niqab, a type of veil worn by some Muslim women, and whether or not new Canadian citizens should be banned from wearing it during the citizenship oath. The Conservative Party also opened a “barbaric cultural practices” hotline to public ridicule and scorn. When the Liberals’ lead in opinion polls began to widen in the campaign’s closing days, Harper even embraced Rob Ford, the disgraced former mayor of Toronto, to shore up his support among Ford’s constituents in Ontario, Canada’s most populous province. But his efforts were ultimately to no avail.

Trudeau, the charismatic 43-year-old Liberal leader, will become the second-youngest prime minister in Canadian history. Although a relative novice in the House of Commons, he is no stranger to the trappings of power. His father, Pierre Trudeau, served as prime minister from 1968 to 1979 and again from 1980 to 1984. During his lengthy tenure in office, the elder Trudeau severed Canada’s last legal ties to Britain, passed the Canadian Charter of Rights and Freedoms, enshrined multiculturalism and bilingualism as national policy, and dominated the Canadian political scene like no other postwar prime minister.

Although the final few days of opinion polling suggested a strong Liberal showing, the younger Trudeau’s victory is nevertheless one of the most surprising upsets in Canadian electoral history. Never before has the third-ranked party in one Canadian parliament won a majority government in the next one. Trudeau himself only became the leader of the Liberal Party in 2013—a meteoric rise by any standard.

Yet Trudeau’s ascension to the prime minister’s office had been predicted over four decades earlier. At a state dinner hosted by Pierre Trudeau in April 1972, U.S. President Richard Nixon raised a glass to the Canadian prime minister’s then-four-month-old son. “Tonight we’ll dispense with the formalities,” Nixon told the assembled guests, according to the CBC. “I’d like to toast the future prime minister of Canada: to Justin Pierre Trudeau.”