We granted a certificate of probable cause to appeal in this habeas corpus case, asking the parties to address the following questions:
“1. What is the appropriate procedure for challenging the validity of an agreement between a criminal defendant and a district attorney in which the defendant agrees never to seek any form of relief from life imprisonment?
“2. Can a defendant waive the right to seek any form of *519relief from life imprisonment, including habeas corpus relief, as part of an agreement to plead guilty to criminal charges?”
We answer these questions as follows: A defendant can waive the right to seek relief from life imprisonment as part of an agreement to plead guilty to criminal charges. The waiver is constitutional and enforceable; it does not contravene public policy. The defendant can challenge the validity of the agreement via habeas corpus; however, the scope of the inquiry is limited to the knowing and voluntary nature of the agreement.
Allen was charged with two counts of kidnapping, two counts of armed robbery and two counts of murder. He entered into a written agreement with the state in which the state agreed to waive the death penalty and recommend a life sentence on each count of the indictment and Allen agreed he would serve the remainder of his life in prison and “never apply, orally or in writing, for parole, commutation of his sentence, reprieve, or any other form of relief from life imprisonment.” The agreement concludes: “[Allen] enters into this contract with full awareness of what he is doing and he will not later attempt to rescind, void or revoke it.” It was signed by the district attorney, Allen, and his attorneys.
That same day, Allen pled guilty to all six counts of the indictment and was sentenced to six consecutive life terms. Thereafter, Allen filed a petition for habeas corpus, asserting the agreement was “unconstitutional and invalid.” The habeas judge denied relief.
1. In determining whether habeas corpus provides an available remedy in any given case, we must keep in mind that
it was the intent of the legislature ... to make the remedy more readily available to prisoners resorting to the Georgia courts and to facilitate a determination in each case ... of the legality or illegality of the imprisonment.
Johnson v. Caldwell, 229 Ga. 548, 550 (192 SE2d 900) (1972). With the intent of the legislature in mind, we conclude that our habeas corpus procedure enables Allen to challenge the validity of his agreement with the state. See OCGA § 9-14-42 (a); Parris v. State, 232 Ga. 687 (208 SE2d 493) (1974).
2. In Thomas v. State, 260 Ga. 262 (392 SE2d 520) (1990), Thomas entered into an agreement with the state in which he waived his right to appeal in exchange for the state’s waiver of the death penalty. Thomas appealed anyway and this Court dismissed, holding that a criminal defendant’s waiver of his right to appeal did not violate public policy, and was constitutional and enforceable. In so holding, this Court observed that waivers of the right to appeal have been *520upheld even where death sentences were imposed. Id. at 264 (citing Gilmore v. Utah, 429 U. S. 1012 (97 SC 436, 50 LE2d 632) (1976) and Whitmore v. Arkansas, 495 U. S. 149 (110 SC 1717, 109 LE2d 135) (1990)).
We can see no reason to distinguish between waivers of the right to appeal and waivers of the right to seek post-conviction relief from life imprisonment. In each instance, the waivers foster the interests of the state and the defendant in finality. “Only by holding the defendant and the state to the bargain is finality achieved.” Thomas v. State, supra at 264.
We hold, therefore, that the agreement between Allen and the state is neither unconstitutional nor invalid. On the contrary, the agreement comports with public policy; and it is enforceable.
This is not to say that Allen cannot challenge the knowing and voluntary nature of the agreement. After all, a waiver of a right to appeal or to seek post-conviction relief must be knowing, intelligent and voluntary. Id.
A review of the record demonstrates that Allen entered into the agreement knowingly, intelligently, voluntarily, and with the able assistance of counsel. It follows that Allen is bound by the agreement and that he cannot seek relief from his life sentence.
Judgment affirmed.
All the Justices concur, except Benham, P. J., and Sears, J., who dissent.