Foreign Minister Winston Peters says New Zealand was aware of talk about a potential attack on Iran by Israel before it happened.
The two countries have been launching deadly attacks on each other since Israel first struck Iran on Friday.
Winston Peters said the government was "surprised, but not totally surprised".
"There had been talk of that but not in a way the New Zealand government was remotely involved in, or aware of.
"But our job is to keep our ears open and to be watching circumstances world-wide," he said, when asked to explain what that meant.
Asked if the United States advised about the attack, Winston Peters said people should not rush to judgement at this point.
He said any New Zealanders in Israel or Iran who could leave, should do so.
He earlier outlined New Zealand's position on the conflict: "We want diplomacy - as we've just engaged in, in Europe recently and in Jakarta in the last few days. We want de-escalation. We want a two-state solution with Israel and Palestinians living in peace and security side by side.
"We want peace and we want balance and calm, and the fact to be acknowledged that the problems in the Middle East don't come from one bad actor alone.
"We don't want New Zealanders in harm's way, we don't want a nuclear Iran, we don't want civilians starving or dying in military conflict and we don't want Hamas holding hostages and terrorising Palestinians, and we don't want Israel occupying Palestinian lands."
He said the current state of global affairs was probably the worst he remembered in his lifetime since the Cuban Missile Crisis.
Sign up for Ngā Pitopito Kōrero, a daily newsletter curated by our editors and delivered straight to your inbox every weekday.