Image copyright AFP Image caption New Zealand's Treasury reported the hack to police

New Zealand's main opposition party has denied hacking into the government's computer systems to steal documents relating to the country's budget.

The National Party, which leaked details of the budget two days ahead of schedule on Tuesday, said it got the information legitimately.

On Wednesday the Treasury said its systems had been "deliberately and systematically hacked".

It confirmed the matter had been referred to police.

Treasury Secretary Gabriel Makhlouf said hackers had attacked government systems 2,000 times over 48 hours.

National Party leader Simon Bridges accused Prime Minister Jacinda Ardern's government of conducting a "witch-hunt" to cover up its embarrassment.

"There has been no hacking under any definition of that word," he said. "There has been entirely appropriate behaviour from the National Party the whole way through. There has been nothing illegal or even approaching that.

"They [the government] are not in control of what they are doing, so they are lashing out and they are having a witch-hunt."

Prime Minister Ardern said in response that no one was linking the alleged hacking with the National Party. The Treasury has not specified who was behind the hack.

The upcoming budget from Ms Ardern's administration has been dubbed the "well-being" budget. It is expected to focus the country's spending on areas beyond economic growth and to prioritise issues like mental health, child poverty and domestic abuse.

Releasing partial details on Tuesday, the National Party derided it as having "no substance".

Reacting to the criticism, the government said some of the leaked data was not correct and that the budget would still be revealed on Thursday as planned.