New Zealand is set for a centre-left coalition government led by Labour head Jacinda Ardern.
Ms Ardern has been opposition leader for the last three months. At 37, she is set to be the country's youngest prime minister since 1856.
Her Labour Party came second in September's election, where no party was able to secure a majority.
They are now tipped for power after the small New Zealand First party agreed to join them in government.
The new coalition will also be supported by the Green Party.
'Now is when the hard work begins'
Analysis by Hywel Griffith, BBC News
Jacinda Ardern has already proved she can run a good campaign and broker a political deal - but now she faces new challenges.
High on her to-do list will be convincing the majority of New Zealanders who didn't vote for her that the party which came second should be in power.
There are also bridges to build with the Australian government - which accused the New Zealand Labour party of conspiring against it in the current dual-nationals crisis.
But the biggest challenge could be keeping her new coalition on the tracks.
Her likely Deputy Prime Minister Winston Peters is known to hold a real dislike for the Green Party, on which the government will depend to get its policies through.
Arguably, now is when the real hard work beings.
New Zealand First head Winston Peters on Thursday announced his party's decision to ally itself with Labour, after 26 days of negotiations.
His party holds the balance of power with nine seats, while the Labour-Green bloc has 54 seats and the National Party 56 seats.
He said his party was faced with a decision between "modified status quo or change" and decided to go for change.
The campaign ahead of the September general election had seen a tightly contested race between incumbent Bill English, from the National Party, and rising political star Jacinda Ardern.
The strong Labour support, dubbed "Jacinda-mania", brought the party neck and neck with the National Party, though supported dropped slightly in the last days of the campaign.
Ms Ardern had targeted young New Zealanders with policies on education subsidies, housing and the environment.
Who is Jacinda Ardern?
- Involved in left-wing politics since her teens - including spending time in the UK as policy adviser to Tony Blair
- First entered parliament in 2008, at the age of 28
- Took over the Labour leadership on 31 July
- Made tackling inequality, affordable housing and student debt a key part of her election campaign
- Has been outspoken on feminism and mental health
- Brought up a Mormon - but left the faith over its opposition to same-sex marriage
Speaking to reporters after the coalition deal was announced, Ms Ardern said: "I feel extraordinarily honoured and privileged to be in the position to form a government with Labour at the lead."
She said the government would work hard to deliver on its campaign promises, and that New Zealand First would have four cabinet positions and one parliamentary under-secretary.
Correspondents say the new coalition is likely to mean a significant cut to immigration quotas and new controls on foreign ownership of property.
Bill English became prime minister in 2016 when his predecessor John Key unexpectedly resigned.
He had promised voters experience and reliable economic management.