
322 S.W.3d 771 (2010)
In the Matter of the Expunction of D.R.R.
No. 08-08-00064-CV.
Court of Appeals of Texas, El Paso.
August 11, 2010.
*772 Janet I. Monteros, Assistant County Attorney, El Paso, TX, for Appellant.
John Gates, El Paso, TX, for Appellee.
Before CHEW, C.J., RIVERA, J., and GARCIA, Judge.

OPINION ON REHEARING
GUADALUPE RIVERA, Justice.
Appellant, County of El Paso, Texas (County), appeals the trial court's order granting an expunction of Appellee's arrest for possession of marijuana under two ounces. On February 10, 2010, we issued an opinion reversing that order and rendering that Appellee's petition for expunction be denied. Subsequently, Appellee filed a motion for rehearing. We deny his motion for rehearing but withdraw our previous opinion and substitute this opinion in its stead. Our previous judgment remains unchanged.

BACKGROUND
This appeal centers on the filing of a petition to expunge the records of Appellee's arrest on November 29, 2002, for possession of marijuana. On November 28, 2007, a hearing was held regarding the expungement petition. The evidence adduced at the hearing revealed that Appellee, represented by counsel, and the State of Texas entered into an agreement whereby Appellee would enroll in a pre-trial diversion program, and upon completion of that program, the charge for possession of marijuana under two ounces would be dismissed. Appellant was seventeen years old at the time, and he was charged as an adult.
In order to enroll in the program, Appellee went to the offices of the Adult Probation Department to sign the requisite forms. He was not accompanied by counsel. There, he signed a document agreeing to participate in the pre-trial diversion program and to abide by certain conditions. The document also contained a provision indicating that if he successfully completed the pre-trial diversion program, he voluntarily waived any right to an expunction. Appellee signed his name, voluntarily agreeing to waive his right to expunction, beneath the provision. The last line of the document also recited that Appellee read and understood the document fully, and Appellee, indicating his understanding of the document, signed below that provision, as well.
Upon his successful completion of his participation in the pre-trial diversion program, the charge of possession of marijuana under two ounces was dismissed by the court. Appellee testified at the expunction hearing that he was unfamiliar with the word "expunction" when he signed the forms, and the rights that he waived were not explained to him. He stated that the purpose in seeking the expunction was to enlist in the United States Navy.
Noting that Appellee was only seventeen years old at the time he waived his right to expunction, the court believed that he did not have the capacity to contract for himself regarding that right. Thus, the court granted the petition for expunction.

DISCUSSION
In its sole issue on appeal, the County asserts the court abused its discretion in granting Appellee's petition for expunction by ruling that Appellee lacked the capacity to contract; thereby invalidating his waiver of his right to expunge his criminal records. We review a trial court's ruling on a petition for expunction under *773 an abuse of discretion standard. Ex parte Jackson, 132 S.W.3d 713, 715 (Tex.App.-Dallas 2004, no pet.); see also Tex. Dep't of Pub. Safety v. J.H.J., 274 S.W.3d 803, 806 (Tex.App.-Houston [14th Dist.] 2008, no pet.). A trial court abuses its discretion if it acts in an arbitrary or unreasonable manner without reference to any guiding rules or principles. Cire v. Cummings, 134 S.W.3d 835, 838-39 (Tex.2004); Bowie Memorial Hospital v. Wright, 79 S.W.3d 48, 52 (Tex.2002).
Appellee was charged as an adult for committing the offense of possession of marijuana under two ounces. He was seventeen years old at the time of the offense. Section 8.07(b) of the Penal Code provides in relevant part:
Unless the juvenile court waives jurisdiction under Section 54.02, Family Code, and certifies the individual for criminal prosecution or the juvenile court has previously waived jurisdiction under that section and certified the individual for criminal prosecution, a person may not be prosecuted for or convicted of any offense committed before reaching 17 years of age....
Tex. Penal Code Ann. § 8.07(b) (Vernon Supp. 2009).
Pre-trial diversion agreements, in our view, are akin to negotiated plea agreements, which have been equated to a contract. See Ex parte Williams, 637 S.W.2d 943, 948 (Tex.Crim.App.1982). Whereas plea bargaining consists of the prosecutor's concessions regarding punishment, lesser charges or reduction in counts in exchange for a defendant's plea of guilty or nolo contendere, see id. at 947, pre-trial diversion agreements generally consists of the prosecutor's agreement to drop the charges in exchange for the defendant's agreement to fulfill certain conditions within a specific period of time. Fisher v. State, 832 S.W.2d 641, 643 (Tex.App.-Corpus Christi 1992, no pet.). Under either action, each party simply agrees to give up some consequence in exchange for a benefit. See, e.g., Bordenkircher v. Hayes, 434 U.S. 357, 363, 98 S.Ct. 663, 668, 54 L.Ed.2d 604 (1978) (explaining plea bargains "flow [] from `the mutuality of advantage' to defendants and prosecutors, each with his own reasons for wanting to avoid trial"). Here, as part of this contract, Appellee agreed to waive his right to expunge his misdemeanor conviction in exchange for the prosecutor's dismissal of the case upon successful completion of the program. Thus, we believe that when a prosecutor and defendant enter into such agreements, they become parties to a contract that are operative. If either party fails to keep their side of the agreement, the proper relief is either specific enforcement or withdrawal of the agreement. See, e.g., Williams, 637 S.W.2d at 947.
Appellee contends that as a minor, one younger than eighteen, he could not make a contract or waive a legal right; accordingly, as his minority disability has not been removed, the waiver is voidable, and he has the option to disallow it. Appellee maintains that in invoking his right to set aside the contract, he has not cancelled out the entire agreement. He cites Ex parte White, 50 Tex.Crim. 473, 474, 98 S.W. 850, 851 (1906), for the proposition that his minority status allows him to plead guilty, but that same disability prevents him from entering into a contract, waiving his rights or forming a contract that may be in contravention of the law or public policy. However, the cited case stands for no more than the proposition that a minor may plead guilty to an offense. Id. Logically, if Appellee can disallow one portion of the contractual agreement, he can disavow any portion of the agreement. This cannot be the intent of the legislature in providing that one has adult status with regard to criminal liability *774 at the age of seventeen. When one who becomes involved with the criminal justice system is considered in his or her majority at age seventeen, that majority status carries over into the attendant contractual agreements. We find that when Appellee entered into a bargain-for pre-trial diversion agreement, that is, a contract, legally at the age of seventeen, he was bound by that contract and its attendant provisions.[1] He cannot absolve himself from those portions of the contract that he, at some later time, finds unsuitable.
We predicate this finding on the concept of estoppel by contract. A party who accepts benefits under a contract is estopped from questioning the contract's existence, validity, or effect. See Rhodes v. State, 240 S.W.3d 882, 891 (Tex.Crim. App.2007) (discussing such principle in a plea-bargain agreement). As is true with most contracts, it is typical that both parties to an agreement will benefit from the result. A defendant cannot enter an agreement, benefit therefrom, and then attack the agreement later when it is suddenly in his interests to do so.[2] Issue One is sustained.

CONCLUSION
We reverse and render judgment denying Appellee's petition for expunction.
GARCIA, Judge, sitting by assignment.
CHEW, C.J., dissenting.
DAVID WELLINGTON CHEW, Chief Justice, dissenting.
I respectfully disagree with the majority's holding.
An individual arrested for either a felony or misdemeanor is entitled to have all records expunged if he (1) has been released, (2) the charge did not result in a final conviction, (3) there was no court-ordered community supervision for any offense other than a Class C misdemeanor, (4) the person has not been convicted of a felony in the five years preceding the date of arrest, and (5) the limitations period has expired. TEX.CODE CRIM. PROC. ANN. art. 55.01(a) (Vernon 2006); In re J.H., 224 S.W.3d 260, 262 (Tex.App.-El Paso 2005, no pet.). Once an applicant who has been acquitted of criminal charges shows that he is eligible under the expunction statute, the trial court has no discretion to refuse the expunction. TEX.CODE CRIM. PROC. ANN. art. 55.01(a); Matter of Wilson, 932 S.W.2d 263, 266 (Tex.App.-El Paso 1996, no writ); Bargas v. State, 164 S.W.3d 763, 770 (Tex.App.-Corpus Christi 2005, no pet.).
Texas law has long established that even though a defendant is a minor, he may still legally enter a plea of guilty to a criminal charge. Ex parte White, 50 Tex.Crim. 473, 474, 98 S.W. 850, 851 (1906). However, a contract made in violation of a statute is illegal. City of Denton v. Municipal Administrative Services, Inc., 59 S.W.3d *775 764, 769 (Tex.App.-Fort Worth 2001, no pet.). Further, a court can refuse to enforce a contract or a contractual provision if it is against public policy and unconscionable. Hoover Slovacek, LLP v. Walton, 206 S.W.3d 557, 562 (Tex.2006). A contractual provision goes against public policy if it is illegal or inconsistent with the public's best interest. Montgomery v. Browder, 930 S.W.2d 772, 778 (Tex.App.-Amarillo 1996, writ denied).
Here, Appellee has satisfied all the requirements in his petition for and to receive an expunction of his arrest. See TEX.CODE CRIM. PROC. ANN. art. 55.01(a); In re J.H., 224 S.W.3d at 262. However, the District Attorney for the 34th Judicial District has a policy requiring defendants, including Appellee, to waive their right to an expunction if they want to enroll in the Pre-Trial Diversion Program. I believe such a policy is inconsistent with the public's best interest because it affects the statutory right to an expunction of not only adults, but also minors. See Montgomery, 930 S.W.2d at 778. As such, the trial court correctly refused to enforce the waiver of Appellee's expunction right that constituted part of his pre-trial diversion agreement. See generally Walton, 206 S.W.3d at 562. This does not render Appellee's entire pre-trial diversion agreement void, however, because a minor may properly enter a guilty plea. See generally Ex parte White, 50 Tex.Crim. at 474, 98 S.W. at 851.
Texas courts have held that contracts entered into by a minor who has not been emancipated are not binding on the minor if he chooses to disallow those contracts. See Swain v. Wiley College, 74 S.W.3d 143, 146-47 (Tex.App.-Texarkana 2002, no pet.). The contract of a minor whose disability has not been judicially removed is not void but only voidable at the minor's choice. Pioneer Casualty Company v. Bush, 457 S.W.2d 165, 168 (Tex.Civ.App.-Tyler 1970, writ ref'd n.r.e.).
In the instant case, Appellee entered into the pre-trial diversion agreement with the State when he was seventeen years old, and so his minority disability was still intact at that time. As such, the waiver of his statutory right to an expunction is voidable, and he has the option to disallow it. See Swain, 74 S.W.3d at 146-47; Bush, 457 S.W.2d at 168. By filing his Original Petition for Expunction, Appellee has exercised his option to disallow the waiver and rightfully seek his right to an expunction.
Finally, the local District Attorney policy requirement that a minor defendant waive his right to an expunction in order to enroll in the Pre-Trial Diversion program seems to contradict the legislative intent behind the expunction statutes. The right to an expunction is statutory in nature, and the legislature could not have intended for an individual to give up such a right by agreeing to enter into a deferred adjudication program when the individual is a minor. See TEX.CODE CRIM. PROC. ANN. art. 55.01(a).
For the foregoing reasons, I respectfully dissent.
NOTES
[1]  We do not address the implications of counsel's absence at the time Appellee signed the pre-trial diversion agreement as those contentions were not raised in the trial court, nor were they argued in Appellee's brief on appeal. And to the extent Appellee seeks to make those argument in his motion for rehearing, it is too late. Morrison v. Chan, 699 S.W.2d 205, 206-07 (Tex.1985).
[2]  The dissent suggests that civil law should apply to allow a minor, being disabled by virtue of his age, to void a portion of his plea agreement, i.e., the waiver of his right to an expunction, at his option. However, the dissent's argument fails as the juvenile was certified as an adult, and as an adult, the juvenile could freely bargain for certain benefits in exchange for waiving other rights in the criminal justice system. See generally Woods v. State, 68 S.W.3d 667, 668, 670 (Tex.Crim. App.2002) (approving of defendant's plea-bargain agreement, who was a juvenile certified as an adult, that waived right of appeal).
