OPINION OF THE COURT
Wachtler, J.The question on this appeal is whether a defendant who pleads guilty to an offense and then gives Grand Jury testimony concerning it prior to being sentenced can claim statutory immunity (CPL 190.40) for the offense to which he has pleaded guilty. The trial court held that the defendant did not acquire immunity under the circumstances, but the Appellate Term reversed and dismissed the charge. The People have appealed.
In 1980 three felony complaints were filed against the defendant charging him with promoting gambling in the *46first degree and possession of gambling records in the first degree. The offenses allegedly occurred on April 17, May 3 and July 23, 1980. On August 28, 1980, the defendant pleaded guilty to three misdemeanor offenses of attempting to promote" gambling, in full satisfaction of the outstanding charges. Pursuant to an agreement with the prosecutor the defendant also made a sworn statement concerning the May 3 offense. This statement related to the activities of a codefendant who had absconded. The court accepted the plea and scheduled the defendant to appear for sentencing on October 23, 1980.
Prior to being sentenced the defendant appeared and testified before the Grand Jury concerning the May 3 transaction. This testimony was given pursuant to a subpoena. The defendant did not assert his right against self incrimination nor did he sign a written waiver of immunity prior to or during his Grand Jury appearance. However, after leaving the Grand Jury the defendant moved to dismiss the charges to which he had previously pleaded guilty, but had not been sentenced, claiming that he had acquired immunity by appearing before the Grand Jury and testifying with respect to these charges.
The defendant relied entirely on the provisions of the Criminal Procedure Law dealing with transactional immunity, particularly CPL 190.40 (subd 2) the relevant portion of which provides that “A witness who gives evidence in a grand jury proceeding receives immunity unless: (a) He has effectively waived such immunity pursuant to section 190.45”. The waiver referred to must be in writing, signed by the witness and sworn to before the Grand Jury (CPL 190.45). The CPL also provides that a person who has acquired immunity cannot “be convicted of any offense or subjected to any penalty or forfeiture for or on account of any transaction * * * concerning which he gave evidence” (CPL 50.10, subd 1). Noting that he had not executed a waiver the defendant claimed that he had therefore automatically acquired immunity pursuant to the statute and could not be penalized or sentenced for the offenses to which he had pleaded guilty.
In opposition to the motion the People argued that the defendant’s rights under the statute were coextensive with *47his right against self incrimination which, it was urged, “terminates” or “expires” when the defendant formally admits his guilt by pleading guilty. The prosecutor also contended that the immunity statute was meant to protect a person against prosecution or conviction in the future and was not “intended as a loophole to avoid the consequences of a plea of guilty already entered”. The prosecutor further observed that the defendant’s Grand Jury testimony only related to the May 3 transaction and thus could provide no basis for dismissing the other charges, even if the defendant’s claim of immunity were accepted.
The trial court denied the motion concluding that the defendant could not claim the benefits of the immunity statute because he relinquished his right against self incrimination when he pleaded guilty. After sentence was imposed the defendant appealed to the Appellate Term. That court reversed the conviction and dismissed the accusatory instrument relating to the May 3 offense but affirmed the other convictions. The court stated: “Having testified before a Grand Jury with regard to the May 3, 1980 offense prior to being sentenced therefor defendant was entitled to immunity and could not be subjected to any penalty on account of that transaction”. (117 Misc 2d 394.)
Both sides cross-applied for leave to appeal to this court from those portions of the Appellate Term’s order which were adverse to them. The People’s application was granted; the defendant’s application was denied. Thus we are only concerned with that portion of the Appellate Term’s order which reversed and dismissed the accusatory instrument relating to the May 3, 1980 transaction.
At the outset a distinction should be drawn between the defendant’s Fifth Amendment right against self incrimination and the broader protection afforded by the immunity statute. The Fifth Amendment simply precludes the People from using statements obtained from the defendant under legal compulsion (Kastigar v United States, 406 US 441). The immunity statute on the other hand grants the defendant full dispensation from criminal liability for an act once he has been compelled to testify concerning the crime (CPL 190.40, 50.10; People v Rappaport, 47 NY2d 308, 313). In this respect the immunity statute is analogous to *48the speedy trial statutes enacted in this State which, although inspired by a constitutional right, provide greater protection than the Constitution requires (see CPL 30.30).
There are good reasons for holding that a defendant who pleads guilty does not automatically waive the constitutional right against self incrimination in all subsequent proceedings. Statements made in such proceedings may be used against the defendant if the conviction based on the plea is set aside on appeal (People v Evans, 58 NY2d 14). Even if the plea is not set aside, the statements may be used by the People at the time of sentence (People ex rel. Hunt v Lane, 132 App Div 406, affd 196 NY 520). As long as these possibilities exist, it may be said that the defendant has a legitimate interest in preserving and asserting his Fifth Amendment rights with respect to an offense for some time following a plea of guilty. Most States which have considered the issue have reached a similar conclusion (see, generally, Ann., 9 ALR3d 990).
However, there is no reason to hold that the broader statutory right to immunity is also available to a defendant following his plea of guilty. In cases where a constitutional right survives a plea, we have held that a related statutory right is forfeited by the plea when the statute would confer on the defendant greater rights than the Constitution demands (see, e.g., People v Thill, 52 NY2d 1020; People v Friscia, 51 NY2d 845; People v Howe, 56 NY2d 622). The same rule should apply to the statutory right of immunity.
A defendant can have no legitimate expectation of obtaining complete immunity from prosecution or punishment for an offense once he has pleaded guilty to the crime. Thus the statutory right to full immunity is fundamentally inconsistent with a plea of guilty and should be deemed forfeited at the time the defendant enters the guilty plea (cf. People v Thomas, 53 NY2d 338). The fact that the statute prescribes a formal method for waiving the right is irrelevant because the question is not whether the defendant made a knowing and intelligent waiver, but whether a forfeiture of the statutory right was, as a matter of policy, a necessary consequence of the guilty plea (see, e.g., People *49v Thomas, supra, at p 342, n 2; People v Howe, supra; cf. People v Parker, 57 NY2d 136).
In- our view logic would seem to compel the conclusion that a defendant who has admitted his guilt in open court and has agreed to accept the sentence of the court has necessarily relinquished any statutory right he might otherwise have to obtain immunity from prosecution and punishment related to that particular offense (cf. People v Thomas, supra). To permit a defendant who has previously been convicted of an offense as a result of a guilty plea to obtain immunity, when a Grand Jury subsequently calls him to testify concerning that same crime, introduces an element of chance and gamesmanship which is inconsistent with the ends of justice, is not warranted by any legitimate interests of the defendant, and cannot reasonably be said to have been intended by the Legislature.
It should be emphasized that this case poses a very narrow issue resulting from a peculiar set of facts. There is no need to consider whether a defendant who has been convicted at trial would acquire immunity if he were to give Grand Jury testimony prior to being sentenced, or whether the rule precluding a defendant from retroactively acquiring immunity after sentence (People ex rel. Hunt v Lane, supra) would also apply if the judgment imposing sentence was being appealed or otherwise being challenged at the time the testimony is given. We simply hold that a defendant who pleads guilty and then happens to give Grand Jury testimony concerning the offense before sentence is imposed cannot claim to have acquired statutory immunity from prosecution or punishment for the offense to which he has pleaded guilty.
Accordingly, the order of the Appellate Term should be reversed and the case remitted to that court to consider the facts and any unresolved questions of law.
Chief Judge Cooke and Judges Jasen, Jones, Meyer, Simons and Kaye concur.
Order reversed and case remitted to the Appellate Term, 9th and 10th Judicial Districts, for further proceedings in accordance with the opinion therein.