The Green Party has struck an eleventh hour deal on anti-terrorism legislation after a breakdown in negotiations between Labour and National.
The tough measures clamping down on returning foreign fighters - like the so-called "Bumbling jihadi" Mark Taylor - had hit a roadblock with a war of words breaking out between the Justice Minister Andrew Little and the Opposition.
With the Greens on board, the government now no longer needs the support of the National Party to get it across the line.
RNZ political reporter Jo Moir has been following developments.