The Utah Supreme Court has vacated the 15-year-to-life prison sentence of a Cache County man who pleaded guilty and mentally ill to child sex charges, and ordered a mental competency hearing for him.

In its ruling, released Wednesday, the justices said 1st District Judge VeNoy Christoffersen erred in not holding the required hearing to determine if Darrel Copeland should be committed to the Utah State Hospital instead of prison.Two doctors who examined Copeland after he was charged found him to be sane but "mentally ill due to recurrent episodes of major depression."

The defendant pleaded guilty and mentally ill in a plea bargain with prosecutors and admitted sod-omizing a 7-year-old girl on May 1, 1985, and sexually abusing her over an extended period.

But, prior to sentencing, Christoffersen failed to hold the required mental hearing. And he refused to allow Copeland to withdraw his guilty plea before sentencing him to the maximum prison term.

Justice Christine Durham, writing for the majority, also ordered Christoffersen to determine whether prosecutors upheld their part of the plea bargain.

"There are several problems with the plea bargain entered into by defendant," Durham said. "It appears either that he misunderstood the promise the state made to him regarding its sentencing recommendation or that the promise was illusory."

In addition, the court said, there was a question whether Copeland understood the minimum mandatory sentencing laws for child sex abusers and "the value of the bargain into which he was entering."

In addition, it was unclear what prosecutors promised, Durham said.

Defense attorney Robert Gutke told the judge the state was to recommend Copeland be committed to the state hospital and prosecutors did not object, creating the inference that it was true.

But a pre-sentence report said prosecutors recommended a minimum 15-year prison term.