Scientists who have been studying fairy terns at Mangawhai on Northland's east coast now suspect the bird's decline may be linked to the removal of mangroves from the harbour.
The critically endangered birds have had a disastrous breeding season after stormy weather in spring, with just two chicks fledging.
But the scientists said the decline started with mangrove removal a few years ago.
In 2015, the Mangawhai Harbour Restoration Society destroyed an island of mature mangrove trees that had grown up in the Mangawhai Harbour.
The group believes the harbour is under threat from silt and unmanaged mangrove expansion, also putting navigation and amenity values at risk.
In 2014 it gained consent from the Environment Court to remove the trees by hand, but was able to use heavy machinery after the Northland Regional Council granted a variation of the consent.
Society secretary Jerry Pilmer said the diggers did a great job of removing what he described as unsightly pests.
"They're a weed. They just grow shallow-rooted in mud.
"Our contractor who did it used a 20-tonne digger and backhoe and just snapped them off. We dumped them in a farm gully. The more we get rid of the better - they're just disgusting," Mr Pilmer said.
But scientists who've studied the Mangawhai fairy terns now think the despised mangroves may have been playing an important role in the survival of New Zealand's rarest bird.
New Zealand Fairy Tern Trust chair Heather Rogan said as soon as the mangroves were removed, egg production plummeted.
"The year before the mangroves were removed there were 18 eggs laid on the Mangawhai sandspit, and the following year, there were five. That's quite a big drop."
Ian Southey, an independent scientist who's been observing the fairy terns and advising the Trust, said egg production had never really recovered since the mangrove removal.
"The simple fact of the matter is they're not laying eggs like they used to.
"The average clutch size is smaller; the percentage of fertile eggs has declined and the ability to re-lay if the clutch is lost has declined dramatically, perhaps almost disappeared," he said.
The problem was specific to Mangawhai: breeding success rates in other locations was largely unchanged, Mr Southey said.
He and other ornithologists said the female fairy tern appeared to decide how many eggs to lay and whether to try again if the nest was destroyed, based on the abundance of food presented to her by her mate, early in the breeding season.
They suspect what has happened at Mangawhai, is that the birds have lost access to a close and plentiful supply of goby - little fish that were found around the mangrove island.
Jerry Pilmer of the Harbour Restoration Trust is adamant there's no life in the mangroves.
But a scientist who studied fairy tern feeding habits at Mangawhai in 2011, Karen Baird, said the research showed gobies were most abundant around the mangrove edges.
And for parent birds feeding their fledglings a fish every two minutes, those had been favourite and possibly critical foraging spots.
"To our way of thinking this is a potential contributing factor [to the breeding failures]. We don't have all the answers, but we do believe that because the birds are so critically endangered that you need to take a conservative approach to managing their habitat.
"Mucking around with it, removing mangroves on a whim just doesn't seem to make any sense," she said.
The Harbour Restoration Society had wanted to remove all mangroves from the harbour, but the Regional Council had objected and the Environment Court decision, allowing the removal only of the mangrove island, was an unfortunate compromise Ms Baird said.
DOC scientist Tony Beauchamp believes the five storms that hit Northland's east coast last spring were a major factor in the disastrous breeding season for the fairy terns.
But their impact on the birds was made worse by the removal of the mangroves, which had stabilised silt, he said.
"In the past the silt was captured by the mangroves, and by removing them you are opening it up to be re-suspended in the harbour."
And that made it difficult for the birds to spot their prey.
Last November Mr Beauchamp watched a pair of fairy terns trying to feed after the storms.
"The mate at low tide was able to able to provide her with food; she was actually on the sand; but before that both of them had been trying to feed in the area and I didn't see any successful feeding at all."
Mr Southey believes the fate of the fairy terns has reached a crisis point.
"It may be that we need to start getting creative and look at supplementing their food supply if that's possible. Or even restoring mangroves," he said.