Late on a Wednesday afternoon in January, Justin Trudeau, the 43-year-old leader of Canada’s Liberal Party and a candidate for prime minister, had just finished sparring at a boxing gym in Windsor, Ontario. He was sweaty from the bout, and as he rode through a snowstorm to an Italian banquet hall for a rally, he worried about how he’d sneak in. “I’m in my boxing gear,” he said. “It’s awkward.” He also rehearsed his speech: The day before, in London, Ontario, he had opened with “This place is important,” but he wanted to change it up. “This place matters,” he said, editing himself. “Windsor matters. This place is too generic.”

After slipping into the building, Trudeau found a shower, but decided to pass because there was no hot water. “Hair is as good as it can get,” he announced. The length of Trudeau’s hair has been a source of tension between him and his staff, but the demands of professional politics are winning out: as he has gone from parliamentary backbencher to party leader, his hockey hair has steadily gotten shorter. Today, he looks less like a goalie than an assistant coach. After he ordered some dinner—a whole pizza topped with rapini, and a regular Coke—an aide ran through various bits of business. She informed him that his wife, Sophie, with whom he has three children, had given him the green light to hold an evening rally the next week in Ottawa. “I’m taking her to a Margaret Atwood ballet on Saturday, so I think she owes me one,” he said, joking that he might bring a flask. He looked in the mirror, wiped his forehead, and retied his tie.

It was showtime. Bounding into the ballroom, Trudeau was greeted by hundreds of clapping Windsorites. He took the podium in front of a giant, freshly steamed Canadian flag that travels in its own suitcase. “I’m here tonight because Windsor matters,” he said. People cheered. “It’s about time we had a government in Ottawa that understood that.”

The government in Ottawa is, of course, that of Prime Minister Stephen Harper. During his nine years in power, Harper, a Conservative from Alberta, has managed to nudge politics well to the right of center, at least by Canadian standards. He has lowered corporate and sales taxes, kept the country out of international climate agreements, and toughened criminal sentences.

Harper is due to face voters on or before October 19, in what is likely to be his toughest fight yet. In part, that is because his leading opponent is the son of the man who—according to a survey conducted by Harper’s own government—is widely considered the most inspiring Canadian of all time: Pierre Elliott Trudeau. The elder Trudeau served as prime minister almost continuously from 1968 to 1984, keeping the country together in the face of a separatist movement in Quebec, distancing Canada from the foreign policies of Richard Nixon and Ronald Reagan, and, in 1982, formally liberating the Canadian constitution from British control. He was cerebral—educated at Harvard, Sciences Po, and the London School of Economics, he sometimes annotated documents in Latin—yet dashing and spontaneous. Photographers caught him sliding down a banister, and performing a pirouette behind Queen Elizabeth’s back. He dated Barbra Streisand at one point. He was known to wear a cape.

The year before he became prime minister, Pierre met Margaret Sinclair, a self-described flower child 29 years his junior, at a Club Med in Tahiti. She was vacationing with her parents; he was there to read Edward Gibbon and contemplate his political future. They married in March 1971, and Justin was born that Christmas, followed by two more boys, Alexandre and Michel. But by 1977, the marriage had soured, and Margaret ran away to party with the Rolling Stones, dance at Studio 54, and have a tryst with Ted Kennedy. (She would later reveal that her unhappiness and impulsiveness had stemmed partly from bipolar disorder.) As for Pierre, he moved on to other women, including the actresses Kim Cattrall and Margot Kidder.

Justin and his brothers were the first children to live at 24 Sussex Drive, Canada’s prime-ministerial residence. He recalls a boyhood of canoe outings near the prime minister’s summer residence and flights to foreign capitals, all under the watch of a Royal Canadian Mounted Police security detail. Before he turned 14, he had met Margaret Thatcher, Ronald Reagan, and Helmut Schmidt, and attended Leonid Brezhnev’s funeral. He remembers Princess Diana stopping by 24 Sussex for a swim.

In 1998, the youngest Trudeau son, Michel, was backcountry skiing in British Columbia when an avalanche swept him into a lake. Divers never found his body. Michel’s death was the end of Pierre. It rattled his Roman Catholic faith and, according to his biographer, John English, drained his will to live: he died two years later, after refusing treatment for prostate cancer. And yet Pierre’s death may have marked the beginning of Justin’s political life. Three thousand mourners, including Jimmy Carter, Fidel Castro, Leonard Cohen, and the Aga Khan, gathered in Montreal for the funeral. Justin, who was then 28, delivered a heartfelt if theatrical eulogy, which ended in a teary “Je t’aime, Papa.” Albert Breton, one of the elder Trudeau’s former advisers, remembers another impressed adviser making a prediction in the cathedral: one day, Justin would be prime minister.

Before turning to politics, Justin held a series of odd jobs that his future critics would feast on: snowboarding instructor, nightclub bouncer, white-water-rafting guide, bungee-jumping assistant, actor, camp counselor. (Harper, on a visit to a summer camp last year, joked to a 20-something ex-counselor, “You could be leader of the Liberal Party!”) Today, Trudeau is more likely to refer to his time teaching high school, chairing a youth service organization, and sitting on the board of directors of the Canadian Avalanche Foundation.

Trudeau was elected to parliament, to represent Papineau, Quebec, one of Canada’s poorest and most ethnically diverse electoral districts, in 2008. When he arrived in Ottawa, the Liberal Party was in disarray. Long described as Canada’s “natural governing party,” it was losing ever more seats in parliament. In 2011, under the leadership of Michael Ignatieff, a once and future professor at Harvard’s Kennedy School of Government, the Liberals forfeited a record 43 seats (including Ignatieff’s own, in Toronto). With fewer members of parliament than the socialist New Democratic Party, the Liberal Party for the first time formed neither the government nor the opposition.

In 2013, in the wake of this disaster, Trudeau was selected to lead the Liberal Party (beating out, among others, a constitutional lawyer with whom Pierre, at age 71, had fathered a daughter). The day after his win, the Conservative Party released an attack ad with the tagline “He’s in way over his head.” Between shots of a grave Harper inspecting a construction site and meeting with Barack Obama, the ad spliced slow-motion footage of a goateed Trudeau taking off his shirt at a charity striptease.

Canada is an essentially liberal country. Abortion, gun control, health care, gay marriage, immigration—all the debates that still rage in the United States, Canadians long ago settled in favor of the left. But the country’s liberal soul has long competed with its mildly conservative brain, as its economy is well served by policies that befit a manufacturer and resource-exporter: free trade, industry-friendly environmental regulations, and a heel-dragging approach to climate change. Likewise, when it comes to foreign affairs, Canadians are torn between their self-image as a peace-loving people and the exigencies of their alliance with the superpower to the south. For nearly a decade, the conservative impulse has won out, in the form of Harper.

As the Liberals see it, Harper’s conservatism is not so mild. “There is a stream within this government that is very much right-wing conservative, as you see in the United States,” Trudeau told me. He went on to suggest that Harper is out of step with the country’s fundamentally strong social conscience. “Maybe it’s because our winters are so long, or the spaces between the communities so big, that we had to learn to count on the benevolence of strangers.”

Trudeau is positioning himself as a sensible, center-left alternative. Whereas Harper’s government has voted with Israel at the United Nations and joined with the Obama administration in Iraq, Trudeau says he sees value in not always following Washington’s lead. At the same time, though, he is careful to distance himself from the New Democratic Party to his left. Unlike the NDP, Trudeau supports Keystone XL, the proposed pipeline that would bring oil from Alberta’s tar sands to the United States. And he backed an antiterrorism bill, introduced by Harper after the October shooting in Ottawa, that would expand the powers of Canada’s spy agency. These middle-of-the-road policies, combined with Trudeau’s personal magnetism, appear to be working: the Liberals raised a record amount of money last year, and polls show them tied with the Conservatives.

Earlier this year, pollsters asked Canadians which party leader would be best in various roles. Trudeau—who has, since joining parliament, smoked pot, gotten a tattoo, and practiced yoga in front of the parliament building—was the top choice for vacation buddy, dinner guest, pet-sitter, movie recommender, and wilderness survivor, and was rated “most likely to stop and help if your car was stranded.” Harper got picked for head of a company and contract negotiator.

As the campaign has heated up, each candidate has been keen to poach the other’s strengths. Harper, trying to soften his image, went snowmobiling in Quebec and sang “Sweet Child o’ Mine” at a Christmas party. Trudeau, meanwhile, is trying to boost his credibility on the economy. In recent months, Canadian business pages have been filled with bad news: sliding oil prices, a weakening dollar, an interest-rate cut by the Bank of Canada. Although voters are inclined to punish incumbents during downturns, in this election a bad economy may perversely help Harper, given that more voters view him as a competent economic manager.

And so, back in the banquet hall in Windsor, Trudeau was hammering home an economic message. He took Conservatives to task for introducing new tax cuts. He knocked them for failing to deliver a budget on time, and for blaming the delay on market instability. “I’m a teacher,” he said. “Their excuses sound like the political equivalent of ‘The dog ate my homework.’ ” It was his biggest applause line of the night.

Trudeau stopped speaking and, right on cue, a pulsating track by the Toronto DJ deadmau5 started playing. He joined the crowd, posing for pictures, signing copies of his memoir, and recording a birthday video for someone’s mother. “I feel like I’m at a rock party,” an older female fan said. Another woman called her friends Trudeau groupies.

Still, the previous night’s rally, in London, Ontario, had been even more packed, with even more screaming. When at last Trudeau extricated himself from the Windsor crowd, he seemed let down. “It was a tough room,” he said, before heading off to finish his cold pizza. But there would be more opportunities to impress: a factory tour the next day, followed by a rally in Ottawa and another in Calgary, then a season of endless campaigning.