There was a moment during Monday's broadcast when Peter Mansbridge — the somber, poised anchor leading the CBC’s election night coverage — accidentally referred to Canada’s new prime minister-elect by his father’s name.

That’s perhaps an understandable mistake. Until recently, Justin Trudeau, a photogenic 43-year-old former schoolteacher, was known principally as the somewhat goofy son of the late former prime minister Pierre Trudeau, a political titan who led Canada between 1968 and 1984 with only a brief interruption. But not anymore.

Trudeau entered Canada’s federal election as the untested leader of the Liberals, still wounded from their worst electoral showing in 2011, when the center-left party won only 34 seats in Canada's 338-seat House of Commons. On Tuesday morning, the Liberals woke up having captured 184 ridings, Canada's term for electoral districts — an astonishing gain of 150 seats — and a clear majority in Parliament.

[Quiz: What do you actually know about Canada?]

Much of the credit for the victory is being laid directly at Justin Trudeau's feet. He ran a disciplined, positive election campaign and withstood the attacks of his opponents, including the defeated Conservative Prime Minister Stephen Harper, who attempted to paint Trudeau as an inexperienced naif.

"We beat fear with hope," a beaming Trudeau declared during his victory speech in Montreal. "We beat cynicism with hard work. We beat negative, divisive politics with a positive vision that brings Canadians together."

A referendum on Harper

But Trudeau also benefited from considerable voter discontent with Harper, who until Monday was one of the West's longest-ruling leaders. He held power for nearly a decade, overseeing a shift to the right in a country famed for its North American-style of social democracy. WorldViews explored the dissatisfaction with Harper ahead of the election:

An opinion poll last week found that 71 percent of Canadians wanted to see a change in government. In a controversial, somewhat confusing editorial last week, the Globe and Mail, a leading Canadian daily, endorsed the Conservatives but not Harper, who would inevitably remain prime minister should his party win.

Harper's critics — who now include HBO's British comedian John Oliver — attack the prime minister on numerous grounds, including his pandering to Islamophobes and his conspicuous opposition to climate-change measures.

Under Harper's watch, Canada's economic growth became increasingly yoked to its mining and energy industries. And the country has been hit particularly hard by the recent drop in global oil prices. Of the Group of Seven, or G-7, nations — some of the world's most advanced economies — Canada was the only one to report two consecutive quarters of decline in 2015, according to the Wall Street Journal.

Now, following his dramatic defeat, Harper will also step down from the leadership of the Conservative party. "The people are never wrong," Harper told a crowd in Calgary, after conceding to Trudeau. "The disappointment is my responsibility and mine alone."

The loss is particularly galling for him: In some respects, the 56-year-old Harper built his own right-wing politics as a reaction to the many years of Pierre Trudeau's rule.

In 2000, just a week after the former prime minister's death, Harper penned a scathing attack. "Under his stewardship, the country created huge deficits, a mammoth national debt, high taxes, bloated bureaucracy, rising unemployment, record inflation, curtailed trade and declining competitiveness. From these consequences we have still not fully recovered," Harper wrote in the National Post. "He continues to define the myths that guide the Canadian psyche, but myths they are."

A victory for multiculturalism

Now it's Harper's myths about Canada that are coming under scrutiny. Harper is seen by both critics and supporters as an unabashed neoconservative, a nationalist who championed Western values and a more muscular foreign policy overseas even as he whittled away at some of the more progressive elements of Canadian society. He cut taxes and skirted the issue of climate change while boosting Canada's massive energy industry.

The Liberals under Trudeau intend to raises taxes on the rich, increase public spending on infrastructure and other big projects, and set national targets on carbon emissions.

But few issues loomed larger during this year's divisive 11-week election campaign — unusually lengthy by Canadian standards — than a rather strange debate over the niqab, a full-face veil worn by some devout Muslim women. Harper's Conservatives grandstanded on a ban that the government was trying to force through, despite the objections of Canada's high court, that would block women from wearing the niqab at citizenship ceremonies.

What was an incredibly small matter turned into a wedge issue, aimed at channeling wider fears over Islam, Muslim immigration and the threat of extremism at home and abroad. In various local races, both the Liberals and the left-leaning New Democrats (NDP) were attacked as parties that were soft on the threat of terrorism and Islamist infiltration. The Conservative Party even announced a plan for a hotline so Canadians could phone in reports of "barbaric cultural practices" carried out by their neighbors.

The tactic, though, clearly did not work. Trudeau and NDP leader Tom Mulcair stuck to their guns and called out Harper and the Conservatives, accusing them of resorting to dangerous rhetoric. Back in March, Trudeau delivered a speech that foreshadowed the debate to come, likening Canada's anti-Semitism in the 1930s and 1940s to what he described as the growing Islamophobia of the present.

In his triumphant address Monday night, Trudeau spoke of the Liberals' agenda for "all Canadians" and hailed the grass-roots outreach and work done across the country. He specifically mentioned campaigning in gurudwaras, or Sikh temples, and told an anecdote of meeting a woman wearing a hijab at a rally.

"[She] handed me her infant daughter … and she said she voted for us because she wants her little girl to grow up and make her own choices in life and that the government can’t [decide for her]," Trudeau said, according to the Montreal Gazette.

Trudeau celebrated Canada's diversity and history of tolerance and immigration — a higher proportion of Canada's population is foreign-born than that of the United States. "We know our enviable, inclusive society didn’t happen by accident and won’t continue without effort," he said.

The other defeat

The election result was also a devastating blow for Mulcair's NDP, which had led the official opposition following the 2011 election and was the early front-runner in the race. Though winning some 20 percent of the vote, the party clinched only 44 seats. Extensive Liberal gains in Canada's maritime provinces, Quebec and Ontario came largely at the expense of the NDP. Canadians appeared to jettison the NDP in favor of the party they believed could outperform the Conservatives, who were expected to win a solid third of the vote.

It was an incredible turnaround from the aftermath of the 2011 elections, when some analysts expected the Liberals would never recover and would eventually be swallowed up as a party by the NDP.

"In the end, the NDP ended up seeing much of its vote shift massively and suddenly to the Liberals in Quebec and Ontario," noted a Tuesday editorial in the Globe and Mail. "Voters went to the party that could knock off Mr. Harper." And Trudeau did just that.

More on WorldViews

How a Muslim veil dominated Canada's election campaign

Canada's election: a primer

Trudeau summons history of anti-Semitism when condemning Islamophobia