A law banning prisoners from voting has been found inconsistent with the Bill of Rights Act.
A High Court judge has found the Electoral (Disqualification of Sentenced Prisoners) Amendment Act, passed into law in 2010, puts unjustified limits on prisoners' rights by putting a blanket ban on voting.
Before the law was enacted, only prisoners serving sentences of more than three years were prohibited from voting.
The Attorney-General warned parliament the change contravened the Bill of Rights before it was passed.
Justice Paul Heath said there were inconsistencies in the way the law was applied to criminals, for example, keeping low-level offenders from voting if their sentence coincided with the general election.
"Someone who goes to prison because he or she has no suitable home detention address loses the right to vote, whereas someone sentenced to home detention does not," a statement from the court said.
Justice Heath said a "declaration of inconsistency" was a suitable remedy to the breach.
The case is a major victory for career criminal Arthur William Taylor, who has been convicted more than 150 times and has previously brought cases around other prisoner rights issues, including a ban on smoking.
Last year Taylor unsuccessfully sought to have a court let prisoners vote in the 2014 general election.
Labour, the Greens and the Maori Party voted against the law in 2010, with opposition parties claiming there was no research domestically or internationally that a ban on prisoners voting had an effect on crime rates.