Image copyright Getty Images Image caption The design titled Silver Fern (Black, White and Blue) has been confirmed as the winner

New Zealand has confirmed that the black, white and blue silver fern design won a referendum to become a possible new flag, after the final votes were counted.

A second referendum will be held in March to decide whether to adopt the new flag or keep the current one.

The design was named as a preliminary winner on Friday but this final tally factors in late and overseas votes.

A similar design in red and blue came in a close second.

Image copyright Getty Images Image caption Silver Fern (Red, White and Blue) came in second

Both flags were designed by architect Kyle Lockwood. About 1.5 million votes were cast in the referendum, with a voter turnout of 49%, said New Zealand's election commission.

In pictures: Weird and wonderful entries that lost out

What do schoolchildren think of the new designs?

Image copyright Getty Images Image caption New Zealanders will decide in March whether to keep the current flag, or adopt the new one

Still in third place is Red Peak, a design that was popular on social media and was added to the ballot following an online lobbying campaign.

Image copyright Getty Images Image caption Red Peak, by designer Aaron Dustin, was popular on social media but in the end came in third

The winning design, known officially as Silver Fern (Black, White and Blue), happens to be Prime Minister John Key's pick, and he had earlier expressed delight that it had won in the preliminary tally.

New Zealanders were asked to choose which of five designs they preferred.

The referendum has divided opinion in New Zealand over its cost and timing.

Image copyright NZ Government Image caption The five flag finalists were criticised as being uninspiring

The entire exercise is expected to cost around NZ$27m (£12m, $18m).

Many also took issue with the final five flags on the ballot, saying they were largely uninspiring.

Media playback is unsupported on your device Media caption New Zealand long-listed 40 designs - but not any of these

The decision to choose a new flag has been backed by Mr Key, who has said the current one is too similar to Australia's and that it is time to remove the Union Jack from the current flag.