
297 S.W.3d 338 (2009)
Michael Patrick KENNEDY, Appellant,
v.
The STATE of Texas.
No. PD-1318-08.
Court of Criminal Appeals of Texas.
October 21, 2009.
Gerald H. Goldstein, San Antonio, for appellant.
Sam Katz, Crim. D.A., New Braunfels, Jeffrey L. Van Horn, State's Attorney, Austin, for State.

OPINION
KEASLER, J., delivered the opinion for a unanimous Court.
The Austin Court of Appeals held that Michael Patrick Kennedy had no right to *339 appeal the trial judge's decision to deny part of his suppression motion under the standard for open-plea cases announced in Young v. State.[1] We conclude that this is a charge-bargain case; therefore, Kennedy has the right to appeal under Texas Rule of Appellate Procedure 25.2(a)(2), as interpreted in Shankle v. State.[2]

Background
Kennedy was charged with attempted capital murder and deadly conduct. Before trial, Kennedy moved to suppress evidence seized from his property. After hearing testimony and the parties' arguments at the pretrial suppression hearing, the trial judge granted Kennedy's motion in part and denied it in part. Immediately after this, Kennedy pled guilty to the offense of aggravated assault on a peace officer with a deadly weapon. In admonishing Kennedy, the trial judge said, "This is an open plea with no recommendation. And the range of punishment is not more than 99 years or life, nor less than five years in the Institutional Division of the Texas Department of Criminal Justice; and in addition to that, a fine not to exceed $10,000." The trial judge and the parties then referred to a plea agreement:
THE COURT: Okay. And is that part of your agreement, that there was a deadly weapon used. And counsel have you gone over with your client the effect of pleading true to a deadly weapon?
DEFENSE COUNSEL: Yes, Your Honor. Your Honor, in that regard it is an open plea, but we remind the Court pursuant to our agreement with counsel for the State that this is a contingent plea subject to our right to appeal the motion  the Court's ruling on our motion to suppress.
THE COURT: And also 
PROSECUTOR: It's understood by the State.
THE COURT: And it's also understood, at least by the Court from an off-the-record discussion, that in exchange for this plea of guilty and true to a deadly weapon, that the other two cases will be dismissed upon punishment; is that correct?
PROSECUTOR: Yes, sir.
DEFENSE COUNSEL: That is correct. Your Honor, I would tender to the Court at this time the certification of our right to appeal for purposes of the hearing.
The trial judge accepted Kennedy's plea and explained:
You do understand that except for certain matters, pretrial motions that have been filed and ruled on by the Court  and to my knowledge that is just the hearing we have had today. But subject to that, you have waived any and all rights to appeal, including your motion to bring a motion for a new trial before this Court?
Kennedy's defense attorney acknowledged that Kennedy understood this admonishment. The trial judge then accepted Kennedy's guilty plea, and after holding a punishment hearing, the judge sentenced Kennedy to seventy-five years' confinement. The trial judge certified Kennedy's right to appeal, stating that this
is a plea-bargain case, but matters were raised by written motion filed and ruled on before trial and not withdrawn or waived, and the defendant has the right of appeal[; and]

*340 is a plea-bargain case, but the trial court has given permission to appeal, and the defendant has the right to appeal.

Court of Appeals
Kennedy appealed the trial judge's partial denial of his suppression motion to the Austin Court of Appeals.[3] Although neither party mentioned waiver, the court held that Kennedy waived his right to appeal his first four grounds of error, which challenged the ruling on the motion to suppress, by pleading guilty.[4] The court began its discussion by setting out the rule we established in Young v. State:[5] In open-plea cases,
Whether entered with or without an agreed recommendation of punishment by the State, a valid plea of guilty or nolo contendere "waives" or forfeits the right to appeal a claim of error only when the judgment of guilt was rendered independent of, and is not supported by, the error.
The court then looked to how other courts of appeals have interpreted this holding.[6] It concluded that a defendant may appeal an erroneous ruling after pleading guilty only when there is a direct nexus between the error and the judgment of guilt.[7] The court determined that there was no direct nexus in this case because: (1) none of the evidence that the judge ruled was admissible established any of the elements of the offense that Kennedy pled guilty to and (2) the judgment was supported by other evidence.[8]

Kennedy's Petition for Discretionary Review
Kennedy petitioned us for discretionary review. He contends that the court of appeals improperly employed nothing more than a legal-sufficiency-of-the-evidence review by narrowly focusing on whether the elements of the offense could have been established without the evidence sought to be suppressed. He argues that this approach is contrary to the policy and precedent we relied on in Young. The State concedes that the court of appeals erred in holding that Kennedy waived his right to appeal. Both parties ask us to remand the case to the court of appeals to consider the merits of Kennedy's claim that the trial judge erred in denying his motion to suppress.

Analysis and Resolution
The court of appeals and the parties erred to ignore Rule 25.2(a)(2). Because this is a charge-bargain case, Kennedy had the right to appeal under Texas Rule of Appellate Procedure 25.2(a)(2), as interpreted in our decision in Shankle v. State.[9]
Rule 25.2(a)(2) governs the right to appeal in negotiated plea cases:
In a plea bargain case  that is, a case in which a defendant's plea was guilty or nolo contendere and the punishment did not exceed the punishment recommended by the prosecutor and agreed to by the defendant  a defendant may appeal only:
(A) those matters that were raised by written motion filed and ruled on before trial, or

*341 (B) after getting the trial court's permission to appeal.[10]
In Shankle, we interpreted the meaning of Rule 25.2(a)(2)'s text "punishment recommended by the prosecutor and agreed to by the defendant." In that case, Shankle was charged with aggravated sexual assault of a child and burglary of a habitation.[11] The State filed a plea disclosure in the sexual assault case, which stated that, in exchange for Shankle's guilty plea, the State would not prosecute Shankle for burglary of a habitation.[12] The disclosure also stated that sentencing would be left within the discretion of the trial judge.[13] Shankle pled guilty to aggravated sexual assault and, at the same time, admitted that he committed the burglary of a habitation offense.[14] The case was reset for sentencing.[15] After the trial judge heard testimony at the sentencing hearing, the judge stated that the burglary offense would be taken into account when assessing Shankle's punishment for the aggravated sexual assault case.[16] The trial judge then sentenced Shankle to forty years' imprisonment.[17] Shankle appealed, contending that the trial judge erred by failing to admonish him that he would be required to register as a sex offender.[18]
The Austin Court of Appeals held that Shankle's notice of appeal invoked its jurisdiction and that the trial judge's failure to admonish Shankle about registering as a sex offender was reversible error.[19] We granted review of both the court's holdings.[20] In reviewing the court's first holding under Rule 25.2(a)(2), we made the following inquiry: "The prosecutor and [Shankle] entered into a plea-bargain agreement, but was it an agreement by which the prosecutor recommended, and [Shankle] agreed to, `punishment'?" We held that it was because "charge-bargaining affects punishment."[21] Explaining the concept of charge-bargaining, we said that it "involves questions of whether a defendant will plead guilty to the offense that has been alleged or to a lesser or related offense, and of whether the prosecutor will dismiss, or refrain from bringing, other charges."[22] Continuing, we recognized that "[a]n agreement to dismiss a pending charge, or not to bring an available charge, effectively puts a cap on punishment at the maximum sentence for the charge that is not dismissed."[23] We then held that the court of appeals erred when it addressed Shankle's sex-offender admonishment complaint on appeal because Shankle had no right to appeal under Rule 25.2(a)(2); the forty years' of imprisonment assessed did not exceed the punishment recommended by the prosecutor and agreed to by Shankle.[24]
The court of appeals and the parties in this case incorrectly assumed that Kennedy's *342 right to appeal was not governed by Rule 25.2(a)(2), presumably because the plea papers are titled, "open plea." However, the record in this case shows that the State and Kennedy entered into a charge-bargain agreement. The agreement provided that Kennedy would plead guilty to aggravated assault on a peace officer with a deadly weapon in exchange for a dismissal of the attempted capital murder and deadly conduct charges. Sentencing was left to the discretion of the trial judge. As in Shankle, the charge-bargain agreement effectively capped Shankle's punishment to the applicable punishment range for the agreed-upon offense. Before the agreement, Kennedy was subject to two separate, additional punishments. The first was for attempted capital murder, a first-degree felony that carried a punishment range of imprisonment for life or for any term of no more than ninety-nine years or less than five years in addition to a fine not to exceed $10,000. The second was for deadly conduct, a third-degree felony offense that carried a punishment range of no more than ten years or less than two years in addition to a fine not to exceed $10,000. Under the plea-bargain agreement, Kennedy was subject to a single punishment for a first degree felony offense. This is a similar situation to that which we addressed in Shankle. Because Rule 25.2(a)(2) applies to charge-bargain cases, Kennedy has the right to appeal the trial judge's ruling denying part of his suppression motion. We reverse the Austin Court of Appeals's judgment and remand this case to that court to consider Kennedy's points of error that concern the trial judge's ruling on his suppression motion.
NOTES
[1]  Kennedy v. State, 262 S.W.3d 454, 457-58 (Tex.App.-Austin 2008) (citing Young v. State, 8 S.W.3d 656 (Tex.Crim.App.2000)).
[2]  119 S.W.3d 808 (Tex.Crim.App.2003).
[3]  Id. at 457.
[4]  Id. at 457.
[5]  Id. at 458 (quoting Young, 8 S.W.3d at 666-67).
[6]  Id. at 458-59.
[7]  Id. at 458.
[8]  Id. at 459-60.
[9]  119 S.W.3d 808 (Tex.Crim.App.2003).
[10]  TEX.R.APP. P. 25.2(a)(2) (Vernon Supp. 2009).
[11]  Id.
[12]  Id.
[13]  Id.
[14]  Id.
[15]  Id.
[16]  Id. at 809-10.
[17]  Id. at 810.
[18]  Id.
[19]  Id.
[20]  Id.
[21]  Id. at 812.
[22]  Id. at 813.
[23]  Id.
[24]  Id. at 814.
