The deadlock was broken when Ms Ardern's Labour Party got the support from a small nationalist party called New Zealand First.
At an inconclusive election on 23 September, the country's major parties failed to win control of the government, making New Zealand First's leader Winston Peters an unexpected kingmaker.
Mr Peters said the charismatic new leader, who has become something of a celebrity politician in the country of 4.6 million, "exhibited extraordinary talent in the campaign itself from a very hopeless position".
The decision, announced on Thursday, makes Ms Ardern, 37, New Zealand's youngest leader and third female Prime Minister.
Mr Ardern - who was elected leader of the Labour Party just three months ago - has been compared to other young leaders such as French President Emmanuel Macron and Canadian Prime Minister Justin Trudeau in Canada.
The election is the first time, since New Zealand's 1996 introduction of proportional representation, that the party with the largest number of votes has failed to secure power.
The conservative National party, headed by incumbent Prime Minister Bill English, returned 56 seats in the election, while a Green and Labour bloc led by Ms Ardern won 54.
In a brief statement in response to the decision, Ms Ardern said it was an "exciting day".