Dino Louis McQuay appeals from judgments convicting him of five counts of first-degree sexual assault and from an order denying postconviction relief. McQuay entered Alford,1 pleas pursuant to a plea agreement, which provided that twenty-four other counts would be dismissed and would not be considered for sentencing purposes. McQuay argues that the state’s reliance on a presentence report which contained information on the twenty-four dismissed counts resulted in a breach of the plea agreement.
Regardless of whether the state’s reliance on the presentence report constituted a breach of the plea agreement, we conclude that McQuay must be resen-tenced. The agreement was contrary to public policy because it kept relevant information from the sentencing court. Because the trial court complied with the plea agreement and disregarded the dismissed counts, the sentence was void. On remand, the trial court must be able to consider the dismissed counts. Prior to resentencing, McQuay should be allowed to renew his motion to withdraw his pleas.
In January of 1987, at a succession of preliminary hearings, the trial court found probable cause to bind McQuay over on twenty-nine counts of first-degree sexual assault involving ten children ranging from approximately eight to thirteen years of age. On April 22, 1987, McQuay entered Alford pleas to five counts pursuant to a written plea agreement. The agreement provided that the state would recommend a twenty-year sentence with a ten-year term of probation. The agreement also stated that “[a] 11 other counts originally filed ... are dismissed outright, are not read in, and will not *826be considered for sentencing purposes.” (Emphasis in original.) At the conclusion of the plea hearing, a presentence investigation was ordered.
The presentence report contained approximately ten pages of information relating to the charged offenses and recommended a longer sentence than twenty years. Prior to sentencing, defense counsel objected to the inclusion of this material as “extraneous, irrelevant, and prejudicial,” but the trial court refused to excise anything from the report.
At sentencing, both the trial court and the prosecutor praised the presentence report. The trial court stated, however, that it would not consider the dismissed counts. The court also told McQuay, “If it weren’t for the plea negotiation, after reading all those things here, there wouldn’t be enough years for this Court to give you.” The court sentenced McQuay to a thirty-year term of imprisonment followed by a twenty-year period of probation.
Agreements by prosecutors not to reveal relevant information to the sentencing judge are against public policy and cannot be respected by the courts. Grant v. State, 73 Wis. 2d 441, 448, 243 N.W.2d 186, 190 (1976). The conducting of a presentence investigation is to be insulated from plea bargains. Farrar v. State, 52 Wis. 2d 651, 656, 191 N.W.2d 214, 217 (1971). Any advance understanding between the prosecutor and defendant must not involve the trial court. Id. at 657, 191 N.W.2d at 217. At sentencing, pertinent factors relating to the defendant’s character and behavioral pattern cannot be immunized by a plea agreement between the defendant and the state. Elias v. State, 93 Wis. 2d 278, 285, 286 N.W.2d 559, 562 (1980). Evidence of such character and *827behavior includes unproven offenses, be they uncharged or pending. Id. at 284, 286 N.W.2d at 562.
The above authorities reveal a strong public policy of providing all relevant information to a trial court charged with the responsibility of sentencing a criminal defendant. Yet, the plea agreement in this case sought to frustrate that policy and asked the trial court to disregard pertinent matters. Plea agreements which are wholly against public policy cannot be respected by the courts. See Grant, 73 Wis. 2d at 448, 243 N.W.2d at 190. Therefore, it was error for the trial court to comply with this portion of the plea agreement.2
Because the trial court sentenced McQuay within the constraints of the plea agreement, the sentence is void. The trial court stated that it would not consider the information relating to the dismissed charges and that if it did, it would have imposed more than thirty years. Sentencing is done for the punishment and rehabilitation of the defendant and for the protection of the public. See Elias, 93 Wis. 2d at 284, 286 N.W.2d at 561. It follows, therefore, that if relevant information is kept from the sentencing court’s consideration by a plea agreement, the public has been harmed.
This situation differs from Grant. There the trial court did consider the relevant information when sentencing, despite the agreement to the contrary. Grant, 73 Wis. 2d at 444, 446-47, 243 N.W.2d at 188, *828189-90. Because Grant was informed of the trial court’s intentions and failed to object, the supreme court concluded that the issue was waived. Id. at 447-48, 243 N.W.2d at 190.3
Having concluded that the sentence is void, we must now decide the appropriate remedy. On appeal, McQuay renews his postconviction request for resen-tencing before a different judge and for a new presen-tence report without the “other offense” information. We have already concluded that this would be contrary to public policy. To protect the public interests, McQuay must be resentenced, but the sentencing court must have access to all relevant information.
Because the sentencing court’s consideration of the dismissed counts will be contrary to the terms of the plea agreement, McQuay may desire to renew his motion for withdrawal of his pleas. Should he do so, the trial court should be guided by the presentence standard to determine if the motion should be granted.4 The case is remanded to the trial court for farther proceedings consistent with this opinion.
By the Court. — Judgments and order affirmed in part, reversed in part and cause remanded with directions.
An Alford plea admits that the prosecution has sufficient evidence to obtain a conviction but does not admit guilt. See North Carolina v. Alford, 400 U.S. 25, 37 (1970).
We would be remiss if we failed to point out the otherwise thorough and complete plea hearing which the trial court conducted. The trial court methodically informed McQuay of the rights which he was waiving. McQuay was also told that the trial court was not bound by the agreement. However, taken in context, this only referred to the length of sentence which could be imposed.
When the federal district court granted a writ of habeas corpus to Grant, it concluded that the facts as presented to the Wisconsin Supreme Court were incorrect. Grant v. Wisconsin, 450 F. Supp. 575, 577 (E.D. Wis. 1978). However, we are persuaded that the principles laid out in Grant v. State, 73 Wis. 2d 441, 243 N.W.2d 186 (1976), under the facts as they were presented to the supreme court, still constitute good law.
To withdraw a plea prior to sentencing, a defendant must present a fair and just reason for doing so, and the prosecution must not have been substantially prejudiced by reliance upon the plea. See State v. Booth, 142 Wis. 2d 232, 235, 418 N.W.2d 20, 21 (Ct. App. 1987).