Prisoners serving a sentence of less than three years will now be able to vote in September's general election.
The prisoner voting bill passed its third and final reading last night, with support from Labour, New Zealand First and the Greens.
Almost 2000 prisoners now have that right, but it doesn't stop there.
In a chaotic night at Parliament, prisoners serving any sentence could be advised they can register with the Electoral Commission even though its not legal for them to cast a vote.
Justice Minister Andrew Little said anyone serving a prison sentence of less than three years should have the right to vote.
"They will be out before the next election, it might be in a month, it might be in eighteen months, but they will be out before the next election and they must have a right to have a say on those running the country that they are about to be released free into."
The Green Party last night put forward two changes to the bill, which were considered in Committee Stage under urgency.
The first, which would see all prisoners given the right to vote, failed to gain enough support.
But, in a bizarre twist, the National Party voted in favour of the second change which removes the Electoral Commission's power to stop disqualified voters from enrolling, a move which makes the bill inconsistent.
National MPs were quick to point out the inconsistency during the bill's third reading and Nick Smith tried to move the bill back to the select committee stage, arguing it was a "shambles" and "unworkable."
ACT's David Seymour chimed in too.
"This is the biggest legislative screw up by this government under urgency for about four weeks, since we accidentally passed the wrong law and unwittingly legislated a $2.5 billion business loan scheme because the government couldn't put the right bill on the table," Seymour said.
Little said the move was "mindless politics" from the Opposition.
Smith denied it was his party's support of the amendment that botched the bill and instead pointed the finger at the government.
"National did not agree with it. We voted for those provisions we supported, we voted against provisions we did not. It is the government's responsibility to be able to have a coordinated position and them ending up with law that makes sense, we've ended up with law that is just a shambles," Smith said.
No one from the Green Party was available to speak to RNZ last night but a spokesperson said the party is waiting for advice on what the changes would actually mean for those in prison.
Regardless of the advice they receive, Little said the amendment will be corrected next week.