Notorious child-killer Benny Haerewa has been sentenced to preventive detention.
The Crown has won its appeal to make his prison sentence indefinite.
In May last year, Haerewa pleaded guilty to 15 charges of serious violence and sexual offending, including wrapping an extension cord around a woman's neck and pulling it tight.
The woman regularly bore the bruising of his attacks and was threatened.
Haerewa also damaged the Housing New Zealand he was in, using a tomahawk to smash holes in the walls of that home and carve messages about him being a "child killer".
These crimes - for which he was jailed for nine years - were the latest in a string of violent offending.
That term included seven years and seven months for sexual violation. However, the Crown appealed that part of the sentence, saying he was at high risk of such offending again.
Two decades ago, Haerewa was jailed for 12 years for the manslaughter of his 4-year-old stepson James Whakaruru in 1999.
The case later became the focus of campaigns to prevent child abuse, sparking widespread condemnation and a review of agency procedures, which failed to recognise the serial abuse.
This included a special report by then Children's Commissioner Roger McClay.
In the appeal, Crown prosecutor Zannah Johnston said Haerewa was at a high risk of
committing serious violent domestic violence upon release.
She also argued preventive detention was needed to protect society.
The Court of Appeal's decision, given by Justice Collins today, noted Haerewa showed an inability to comply with community-based orders.
He had breached his conditions of release after his manslaughter sentence and later withheld information from Oranga Tamariki.
"We are also concerned Mr Haerewa has continued to minimise the impact of his offending and that he even attributes blame to his victims for the circumstances he created," Justice Collins said.
The sentence of seven years and seven months' imprisonment for sexual violation by unlawful sexual connection was quashed and substituted with a sentence of preventive detention.
The minimum period of imprisonment of six years remains in place.