The silver fern flag with black, white and blue colours has come out on top in the first flag referendum.
The flag held a narrow lead in voting when preliminary results were revealed on Friday.
In the official result announced yesterday afternoon, which included all late and overseas votes, the Electoral Commission confirmed it as the winner.
The flag will now go head-to-head with the existing flag in a second referendum in March, which will decide whether New Zealand changes its flag for the first time in more than 100 years. Both silver fern flags were designed by Kyle Lockwood, a New Zealander living in Melbourne.
Under the preferential voting system, the blue and black flag won 50.58 per cent of the vote in the fourth round of voting. The second-placed flag won 49.42 per cent of the vote. The difference between first and second place was 15,000 votes.
The number of informal votes was relatively high at 149,747. The Red Peak flag was third, the black and white silver fern fourth, and the koru flag fifth.
Deputy Prime Minister Bill English, who is in charge of the flag referendum process, said New Zealanders now had a clear choice whether to change the flag or keep the existing one.
"This is a historically significant choice we have in front of us.
"We now have time to consider the two flags side by side and have a good think about which best represents us as a nation now and into the future.
"I'd encourage everyone to have an input in this decision - even those who didn't vote in the first referendum, everybody eligible to vote can do so in the second, conclusive referendum."
A flag must win 50 per cent of the vote to be declared a winner under the preferential voting system. On first preference votes, the red, white and blue flag won 20,000 more votes than the blue, white and black flag. But its total vote amounted to 42 per cent.
That meant the least popular flag, the koru, was eliminated from voting. Voters who had chosen koru as their first preference then had their second preferences come into play for the second count.
Once these votes were redistributed, the red, white and blue flag still led by 20,000 votes, but again failed to get a clear majority. The black and white silver fern flag was then eliminated and second preferences redistributed.
In a third count, the blue, black and white flag surged into the lead by 6000 votes, but only had 44.8 per cent of the total vote.
Once Red Peak was eliminated for the fourth count, the blue, black and white flag emerged with the slenderest of majorities - 50.53 per cent.