Winston Peters was "indignant and defensive" when first notified of an error which had led to him being overpaid his pension, the High Court in Auckland has been told.
A Ministry of Social Development manager, Meredith Nugent, was called by the Crown to give evidence on Wednesday as part of the deputy prime minister's legal action claiming a breach of his privacy.
The case centres on how details of Mr Peters' seven-year overpayment made its way to the media in the lead up to the 2017 election.
The error came to light after Mr Peters' partner Jan Trotman applied for superannuation, highlighting a discrepancy with the NZ First leader's file.
That was escalated to Ms Nugent who was an area manager at the time.
After obtaining and reviewing the original documentation, Ms Nugent determined that "Mr Peters had not declared his relationship on his application".
She said she phoned Mr Peters on 25 July 2017 to inform him of the error and to arrange a follow-up meeting.
"He was very unhappy to be having that discussion and his tone was indignant and defensive.
"He said it was a ministry error, and the clear undertone was: 'how dare we contact him about such a thing?'"
After meeting with Mr Peters, Ms Nugent concluded he had made a "genuine mistake" and there was no need to involve the department's fraud investigators.
She said Mr Peters had seemed "legitimately surprised" at the way he had filled out his pension application form, and had agreed to promptly repay the overpayment.
Ms Nugent said the agency did "everything humanly possible" to keep the case confidential.
"From the moment I learned about the possible anomaly with Mr Peters' superannuation, I appreciated the need to handle this information carefully," Ms Nugent said.
"From my perspective, we did everything humanly possible to ensure the overpayment was kept confidential."
She said she'd intentionally limited the number of people informed and had tried to keep conversations face-to-face or over the phone rather than via email.
"Once the matter started to unfold, we had Mr Peters' records secured on our system to limit who could access them."
Ms Nugent said she felt "sick" when she later saw that the story had reached the media.
Journalists protect source
Earlier in the day, Newshub political journalist Jenna Lynch told the court she had received an anonymous phone call revealing details about the overpayment.
Under questioning by Mr Peters' lawyer Brian Henry, Ms Lynch refused to reveal the person's gender, saying it was clear to her that there had been an "understanding of anonymity".
On Tuesday, NewstalkZB political editor Barry Soper and Newsroom journalist Melanie Reid also declined to identify the source of the leak.
All three reporters were subpoenaed by Mr Henry.