Labour leader Andrew Little says he will withdraw New Zealand troops from Iraq if his party is elected to power next year.
Mr Little said he expected the security situation in the Middle East to change significantly by the general election, by which time the Islamic State may have been pushed back further or defeated.
But if the conflict remained unchanged in Iraq and Syria, he confirmed he would withdraw New Zealand's deployment of 143 trainers from Taji Military Base near Baghdad.
"If it's the same as it is now I cannot see a case for continuing," he told the Herald.
Mr Little, who has expressed concerns about the Iraqi Army's capability, said he would support New Zealand staying in Iraq in a peacekeeping capacity in the event that Isis was defeated.
"If that happens, then there will almost certainly be the need for a peacekeeping operation under a United Nations mandate, which is something we are experienced at and good at."
Mr Little made the comments yesterday after the Government confirmed that the New Zealand Defence Force's two-year deployment to Iraq would be extended by 18 months to November 2018 - a major turnaround given its earlier commitments to end the mission next May.
Prime Minister John Key defended his Government's decision yesterday to stay in Iraq beyond the two-year deadline.
"That was my expectation when we went in there and I had no particular reason to change that view. Over time I've been persuaded with the arguments."
The success of New Zealand's Iraq mission and the impact Isis was having worldwide meant "we need to ask ourselves if it is really acceptable for New Zealand to not play a role", he said.
Isis remained a threat not only in Iraq but domestically because of its ability to motivate radical Islamists.
"We're not insulated from the sort of thing that we saw in Orlando," Defence Minister Gerry Brownlee said, pointing to the shooting in the United States last week that killed 49 people.
Green Party co-leader James Shaw said the Government's change of position opened the door to an indefinite, more dangerous deployment.
"This is mission creep," he said. "The great risk here is given that [Mr Key] has broken his promise to bring them back now, he can then extend it again in time as well as the scope of the mission."
As well as a longer deployment, New Zealand would also begin training forces tasked with keeping peace in cities recaptured from Isis control, and would assist in transporting some Iraqi forces to another military base 50km from Taji.