Finance Minister Grant Robertson initially agreed with the Treasury that there was no need to put tens of millions of dollars more into stopping boat people from reaching New Zealand, but did a U-turn following pressure from Jacinda Ardern.
Treasury documents, released to the Herald under the Official Information Act, reveal that Robertson removed the initial $11.3 million Budget bid from the draft 2019 Budget package in December last year.
But it was re-inserted after the Prime Minister said it should not only be in there, but should be significantly beefed up.
The immigration team at the Ministry of Business, Innovation and Employment then almost tripled the Budget bid to $33.5m over four years.
Robertson eventually signed off $25m over four years, even though no boat people had ever successfully reached New Zealand shores.
Ardern had felt that this area had been underfunded for years and the Budget bid was an attempt to rectify this, a spokesman has told the Herald.
Treasury officials' correspondence shows Robertson had agreed with the Treasury's assessment that there was no need for money to stop the boats, a position shared by Green Party co-leader James Shaw, who is also Associate Finance Minister.
"This [$11.3m] bid was triaged out in December, on the basis that the initiative does not directly align to any of the Budget priorities," Treasury employment and enterprise team leader Elizabeth Gerard wrote to Treasury's Budget manager Alex Harrington in March this year.
"There is no evidence that the existing funding and measures are not sufficient. MoF
[Minister of Finance] agreed with this assessment at the time."
Gerard's email then noted that ministers, understood to be Ardern and Immigration Minister Iain Lees-Galloway, had asked for the funding bid to be increased.
A February email, released under the OIA, from head of Immigration NZ Greg Patchell to MBIE officials noted a "strong steer" from Ardern and Lees-Galloway about its importance.
But Gerard was reluctant for the Treasury to change its assessment unless a New Zealand-bound people-smuggling boat actually made it here.
"This is based on the experience in Australia and Canada, where successful mass arrivals of migrants have resulted in higher rates of attempts - due to the initial successful mass arrival," she said in her email.
A subsequent report from the Treasury noted that the new Budget bid would boost the current funding to stop the boats by a factor of seven.
"If ministers did want to increase spending on preventative measures, we consider that significant scaling would be appropriate," the report said.
It recommended that Robertson ask Lees-Galloway to justify the increased spending and why preventing maritime arrivals was such a priority for him.
MBIE officials justified the Budget bid as plugging gaps in the current system, including two countries whose names are redacted in the released documents.
"We have found we are thin on the ground in source and transit countries [redacted]," a March email from an MBIE official to the Treasury said.
"Having one LO [liaison officer] [redacted] does not meet expectations that we locate people smuggling threats, and be positioned to disrupt when the opportunity arises."
Two and half weeks later, Gerard wrote to a Treasury official recommending that the bid be scaled to 75 per cent, or $25m over four years, which is what Robertson eventually signed off at the end of March.
The Ministry of Foreign Affairs and Trade was very supportive of the bid, though an Mfat official added in an email to MBIE that "as with everything, the devil is in the detail!"
People-smuggling has come up frequently during Ardern's term as Prime Minister, with her repeatedly pushing for Australia to accept New Zealand's long-standing offer to take 150 refugees from Nauru and Manus Island.
She had also intended to raise the offer with her Australian counterpart Scott Morrison while in Singapore for the East Asia Summit last November.
The issue has also sparked clashes between ministers on both sides of the Tasman.
Last year Justice Minister Andrew Little called Australia's policy around deporting New Zealanders "venal", which led to an angry retort from Australia's then-Immigration Minister Peter Dutton.
"New Zealand don't contribute really anything to the defence effort that we've got where we're trying to surveil boats that might be on their way to New Zealand, so I hope that Andrew Little reflects a little more on the relationship between Australia and New Zealand where we do a lot of the heavy lifting," Dutton told The Australian.
Little has previously questioned how credible it was for boat people to reach New Zealand.
"It's simply not credible for someone in a rickety old boat - designed for at best two or three days at sea - to say they're going to sail from Indonesia down to New Zealand," he said in December 2017.