TORONTO — Prime Minister Justin Trudeau faces his first major test as leader of a minority government when Canada’s Parliament reconvenes on Thursday.

The looming hurdle: the Speech from the Throne, in which the Liberal Party leader will lay out his priorities for his second mandate, subject to the approval of the House of Commons, where his rivals now outnumber his friends.

What a difference four years makes. In 2015, the telegenic son of former prime minister Pierre Elliott Trudeau strode into office to international acclaim, a practical liberal promising “sunny ways” in government — with a majority strong enough to make it so.

After an uneven performance cost him that majority in the October election, a chastened Trudeau must rely on the support of other parties to maintain his power. Rather than form a formal coalition, he says, he’ll look for their help on a case-by-case basis.

“He’ll find that he has to listen, that he has to compromise, that he has to work with others,” said Lori Williams, a political scientist at Mount Royal University. “It will be a real test of his leadership to see if he can be a little bit more collaborative.”

The first order of business for the new Parliament will be to elect a speaker of the House. Then, in a ceremony filled with pomp, Governor General Julie Payette — the representative of the monarch in Canada — will read the throne speech.

Written by the prime minister, the speech establishes the government’s agenda, and it could hint at areas where he intends to cooperate with other parties. Typically, after some debate, it’s put to a vote. If it fails to pass, opposition parties can try to form a government, or the country can go back to the polls.

A senior government official, who spoke on the condition of anonymity to discuss internal deliberations, said he expects a vote on the speech in the new year, after Parliament returns from its holiday break.

Before then, lawmakers will have to vote before Dec. 10 on a funding bill to keep the government functioning — another test of confidence. Barring major mishaps, analysts expect Trudeau to get the support he needs.

“It’s probably not in anybody’s interests to have an election right now because they don’t have any money,” said Ian Brodie, a chief of staff for former Conservative prime minister Stephen Harper.

Andrew Scheer, whose Conservatives won the popular vote but fewer seats than Trudeau’s Liberals, has faced growing calls from within the party to step down as leader, making it unlikely the Tories will want to risk an early election. None of the other parties have expressed any interest in working with Scheer as prime minister.

After a bitterly divisive campaign, Trudeau has kept a low profile, meeting behind closed doors with opposition leaders and provincial premiers in the hope of securing their support. Reviews have been mixed: Ontario Premier Doug Ford, a favorite punching bag of Trudeau, called their tête-à-tête “phenomenal.” Saskatchewan Premier Scott Moe said his was “disappointing.”

Trudeau also swore in another gender-balanced cabinet. He moved Chrystia Freeland, praised for her role in negotiating the proposed update to the North American Free Trade Agreement, from the Foreign Ministry to Intergovernmental Affairs, where she’ll aim to quell regional tensions, and named her deputy prime minister, Canada’s first since 2006.

His cabinet also has more members from his home of province of Quebec, where his Liberals suffered some of their deepest losses in October, in an apparent effort to regain support.

Freeland will be navigating a difficult map. The Liberals were shut out of the energy-producing provinces of Alberta and Saskatchewan, Conservative strongholds where opposition to Trudeau’s environmental policies has heightened feelings of alienation. The separatist Bloc Québécois, which more than tripled its representation in Parliament, is opposed to pipeline projects, and its leader, Yves-François Blanchet, has been trading barbs with Alberta Premier Jason Kenney, opening a new front for regional conflict.

Bessma Momani, a political scientist at the University of Waterloo, said the government’s cabinet moves signal “a return to being more domestic-oriented.” With every vote critical to the government’s survival, she said, lawmakers will have less opportunity for international travel, and Canada will have “a diminished presence” on the world stage.

But that doesn’t mean the government’s foreign affairs inbox is empty.

A key priority will be ratifying the United States-Mexico-Canada Agreement, which Canada has said it wants to do “in tandem” with the United States.

Canada is also expected to decide whether to allow Chinese telecom giant Huawei access to its 5G wireless network — a question that further complicates relations with China, which last year arrested two Canadians in what is widely believed to be retaliation for Canada’s arrest of Huawei executive Meng Wanzhou in Vancouver at the behest of U.S. officials seeking her extradition on fraud charges.

Trudeau has sought President Trump’s help in getting China to release former diplomat Michael Kovrig and businessman Michael Spavor. But the roller-coaster relationship between the Canadian and U.S. leaders hit another dip Wednesday when video emerged of Trudeau apparently joking about Trump with French President Emmanuel Macron and British Prime Minister Boris Johnson at the NATO summit in London. Trump responded by calling Trudeau “two-faced.”

Canada has not had a minority government since 2008. Though they don’t typically last longer than two years, they can be productive: Medicare, same-sex marriage, the country’s pension plan and the maple leaf flag all passed with minority governments in power.

Minority governments can fall if they lose a vote on a crucial money bill, such as a budget, or on a vote of no-confidence.

Trudeau’s Liberals appear likeliest to get support from the left-leaning New Democratic Party. The parties are broadly aligned on issues such as middle-class tax cuts, climate change and a national prescription drug program.

“On the big stuff, the government will be okay,” said Brodie, now a political scientist at the University of Calgary. “And the government will probably be okay for quite a while.”

But the Liberals will no longer have a majority on parliamentary committees, and the Conservatives are likely to push for an investigation into Trudeau’s handling of the SNC-Lavalin affair. Canada’s ethics watchdog has found that Trudeau improperly pressured his attorney general to cut an out-of-court settlement with the Montreal-based engineering firm, which is facing bribery and corruption charges.

“[Committee hearings] can do a lot of damage in the short term,” Williams said.

Parties trying to govern with a minority sometimes try to bully election-weary parties or to play them off one another, browbeating them into submission or goading them into triggering an election.

Brodie said Trudeau has the cash-strapped NDP “over a barrel” and could push for an earlier election so he can try to regain his majority.

“It’s gamble for him,” he said. “But I don’t think Mr. Trudeau will be very happy governing in a minority.”