A South Australian pedophile will be re-sentenced after the nation's highest court ruled his current jail term was too harsh, in a decision that could have undermined cases across the country.
The man has become the latest sex offender to have his sentence slashed because of a legal loophole.
He was found guilty at trial of persistent sexual exploitation of a girl under the age of 17 between 2013 and 2016.
For that charge to be proven, a defendant must be found guilty of at least two acts of abuse in a period of more than three days.
But sentencing law allowed sex offenders to be punished only for the least serious of their actions if jurors are not asked to clarify which specific acts their guilty verdict applied to.
In this case, trial jurors in the District Court heard the man stood accused of four acts of sexual exploitation against the girl.
But they were told they must only find he committed two to declare him guilty, and they were never asked how many or which acts had been proven.
Nevertheless, he was handed a sentence of 10 years behind bars with a non-parole period of five years.
A law change rushed through the parliament in late 2017 - after the man was sentenced - moved to close the loophole.
In his High Court appeal, the man successfully argued the amendment did not apply to his case and he should have been sentenced "on the basis of the facts most favourable to him".
He also argued that, if the amendment did apply, it was not legal because it undermined the authority of the state's Supreme Court.
The question of validity was posed to the court with the support of Attorneys-General of Queensland, Victoria, Tasmania and NSW which have similar laws.
But the court ruled the amendment was not called into question.
The man's matter will now be sent back to the District Court for reconsidered sentencing.
In similar circumstances, pedophile teacher Marco Chiro had more than six years slashed from his sentence after the High Court also ruled in his favour.
That decision had an effect on the case of Stephen John Hamra, who abused two young boys in the 1970s and 1980s.