JACINDA ARDERN looked a touch less assured than usual when she took to the stage on October 19th after becoming New Zealand’s prime-minister designate. The 37-year-old had raised Labour from the dead after assuming leadership of it in August, but the centre-left party had still finished second in last month’s general election with just under 37% of the vote. She had managed to secure leadership of the country by turning her charm on the populists of New Zealand First, convincing them to side with her instead of the winning centre-right National Party. With support from the Greens (who are not part of the coalition), Ms Ardern has created the first government of losing parties in New Zealand’s proportionally representative parliament. On October 26th she was sworn in as the world’s youngest female leader.

Ms Ardern’s promises of change resonated with many young New Zealanders. They were tired of the National Party, which had led the country for nearly a decade. But some commentators fret that change may involve a shift towards greater protectionism and an end to three decades of liberal economic reform. The populists and Labour have agreed to cut annual net migration by up to 30,000 people; to strengthen controls on the foreign purchase of farmland; and to renegotiate the Trans-Pacific Partnership, a now-sputtering regional plan for free trade, to curb house-buying by foreigners. The New Zealand dollar took a hit when Winston Peters, the populists’ leader, said he had chosen to side with Labour because “too many New Zealanders have come to view today’s capitalism not as their friend, but as their foe.”

It is true that some locals have felt left behind during a period of strong economic growth but near-stagnant wages. And although most New Zealanders say they are proud of their country’s multicultural mix, a few take umbrage at an upsurge of immigration: annual net migration (new arrivals minus departing locals) has risen to over 70,000 in the country of fewer than 5m people, 16 times as many as in 2008. Many fret about the impact of this on house prices. They also complain that treasured national parks are increasingly jammed by overseas visitors.

Ms Ardern strongly rejects allegations of stoking anti-immigration sentiment. Her party says it only aims to curb an influx of low-skilled migrants. Her populist partners will support her efforts to do so. For backing Labour, they have been rewarded with four seats in the cabinet. Mr Peters has accepted jobs as deputy prime minister and foreign minister. He has held both roles before, in coalitions both with Labour and with the National Party.

The previous prime minister, Bill English, is now the leader of the opposition. Having secured 44% of the vote, his National Party will be a powerful challenger to a government whose ministers have little experience: few members of Ms Ardern’s cabinet have previously held such rank (one is Mr Peters). Moreover, the coalition is weak: the Greens and New Zealand First could not bring themselves to speak to each other during talks to establish the alliance. Ms Ardern has made lofty promises to build 100,000 houses, reduce child poverty and clean up polluted rivers. That will be tough while trying to prevent feuding between her partners. She has shown her powers of persuasion by wooing voters and cobbling together a majority. A far greater challenge lies ahead.