Courts will be able to use video links to speed up cases under legislation passed by Parliament today.
The Courts (Remote Participation) Bill went through on a unanimous vote after Justice Minister Simon Power changed it late last night so defendants have the right to appear in person if they want to.
Opposition MPs had argued that a fair trial could be prejudiced if a defendant was not present in court.
"After listening carefully to the debate over recent days I was persuaded that more explicit protection is needed for the appearance of a defendant at their actual trial," Mr Power said, after the bill had been passed.
"Last night I tabled an amendment which states that video links cannot be used for the appearance of a defendant in a trial to determine his or her guilt or innocence, without the defendant's consent."
Mr Power said video links were likely to be used initially for procedural matters.
The Government has committed about $2 million over the next year to have video link facilities installed in courts and prisons.
The Ministry of Justice anticipated that by 2014 some of the country's busiest courts could each see up to 2000 remand prisoner appearances by video link every year.
The Human Rights Commission welcomed Mr Power's last-minute change to the bill.
Acting chief commissioner Judy McGregor said the commission had strongly opposed the legislation in its original form because it infringed significant human rights issues such as the right to be present in criminal proceedings.
"The minister's leadership should be applauded on human rights grounds...we also welcome his acknowledgement that he was persuaded by robust parliamentary debate," she said.
United Future leader Peter Dunne, another former opponent, said the bill could have resulted in trials with absent defendants becoming the norm, to the disadvantage of the defendant and contrary to the public interest.
"The law is potentially still too open-minded, with the onus now on the defendant to decide how they wish to be tried," he said.
"Nevertheless, I give the minister credit for recognising the major concern about the bill and moving to amend it."
The Greens were also pleased with the minister's amendment.
"It's great to see that the Government has listened to the Green, Labour and Maori parties and protected the right of defendants to be present at their own trial," said justice spokesman Kennedy Graham.