
268 S.W.3d 262 (2008)
In re Jose Urrutia GOMEZ.
No. 03-08-00512-CV.
Court of Appeals of Texas, Austin.
September 16, 2008.
Jacquelyn Christine Stewart, George William Lang II, State Counsel for Offenders, Huntsville, TX, for relator.
David A. Mendoza, Assistant District Attorney, Sherri Tibbe, Hays County District Attorney, San Marcos, TX, for real party in interest.
Before Chief Justice LAW, Justices PURYEAR and PEMBERTON.

OPINION
BOB PEMBERTON, Justice.
Jose Urrutia Gomez petitions for writ of mandamus to compel the district court to enter a nunc pro tunc order modifying his judgment of conviction to reflect back-time credit. For the reasons explained herein, we will conditionally grant relief.
On June 5, 2001, Gomez pled guilty to sexual assault of a child. The written plea agreement was memorialized in a form titled "Plea Bargain Agreement" that contained blanks for numerous potential terms. Only some of the blanks were completed with typed or handwritten notations:
*263
Offense:      SEXUAL ASSAULT OF A CHILD
Degree:       SECOND
Plea to Enhancement Paragraphs:
State to Waive Enhancement Paragraphs:
State to Dismiss:
Confinement:  [handwritten:] 12  years TDCJ ______ Hays County Jail
              __________________ State Jail
              []    Affirmative finding deadly weapon used
              []    Credit agreed for ______ days served
Community
Supervision:  _______________ years TDCJ probated for _______ years
              _______________ State Jail probated for ______ years
              _______________ Hays County Jail probated for ______
              [] ______________ days jail as condition of community supervision
              [] ________ Work Release
              []      Deferred Adjudication probated for _____ years
              []      Fine   $ __________
              []      Court Costs due at time of sentencing
              []      Restitution $ _________
              []      Reimburse Hays County for court appointed attorney
              []      Adult community supervision fee of $ 40.00, payable monthly
Special Terms:
              []      Psychological/Drug/Alcohol Abuse Evaluation & Counseling
                      _______________________________________________________
              []      Intensive Supervision Program
              []      Community Service Restitution: ________ HOURS
[handwritten "x"][]   Other: [handwritten:] "no contact with [two names]"
Thus, of the numerous blanks in the "Plea Bargain Agreement" form, only the following contained notations: (1) the offense (sexual assault of a child); (2) degree (second); (3) the term of confinement (12 years in TDCJ); and (4) a "special term" that Gomez have no contact with two individuals. Additionally, the form specified a $40.00 adult community supervision fee, although none of the boxes relating to that fee or community supervision were checked. Of significance to this proceeding, the box beside "Credit agreed for ____ days served" was left blank, as was the space for indicating the "days served" for which credit had been "agreed."
At the bottom of the page was the following statement:
"THE UNDERSIGNED certify that they have READ ALL TERMS of the above agreement, and the agreement contains ALL the terms of the plea agreement to which they have agreed:"
(Emphasis in original). Immediately below this certification were the signatures of the prosecutor, Gomez, and Gomez's counsel.
Gomez's judgment of conviction, as the State observes, "mirrors the signed plea agreement." The judgment states "PLEA BARGAIN TERMS: TWELVE (12) YEARS INCARCERATION," and "PUNISHMENT AND PLACE OF CONFINEMENT: TWELVE (12) YEARS CONFINEMENT IN THE INSTITUTIONAL *264 DIVISION OF THE TEXAS DEPARTMENT OF CRIMINAL JUSTICE AND A FINE OF NONE." A blank in the judgment form appears beside "TIME CREDITED AGAINST SENTENCE." The parties agree that the judgment did not award any back-time credit.
In March 2008, Gomez filed a motion for judgment nunc pro tunc in the district court requesting that his judgment of conviction awarding no back-time credit be corrected to reflect a total of 160 days credit. In support, Gomez submitted a certification from the Hays County Sheriff's Office reflecting that he had been incarcerated following his arrest on December 23, 2000, and for an additional 159 days between March 19 and August 24, 2001. Gomez's sentencing, June 5, 2001, occurred on the 78th day of the 159-day period in which he was confined in the Hays County Jail. In an order dated July 18, 2008, the district court denied relief, adding that it "further finds that the record accurately reflects the sentence of the Court, including back time." Gomez subsequently sought mandamus with this Court to compel the district court to enter the nunc pro tunc judgment he requested.
Article 42.03, section 2(a) of the code of criminal procedure mandates that "[i]n all criminal cases the judge of the court in which the defendant was convicted shall give the defendant credit on his sentence for the time the defendant has spent (1) in jail in said cause ... from the time of arrest and confinement until his sentence by the trial court." Tex.Code Crim. Proc. Ann. art. 42.03, § 2(a)(1) (West Supp.2008). Consequently, "[t]he trial court is required to grant the [defendant] pre-sentence jail time when sentence is pronounced." See Ex parte Ybarra, 149 S.W.3d 147, 148 (Tex.Crim.App.2004). Reflecting the mandatory, ministerial nature of this duty, the court of criminal appeals has instructed lower courts that "[i]n the event the [trial] court fails to award such credit at the time the sentence is imposed, the trial court has the authority to correct the judgment to reflect the appropriate time credit by nunc pro tunc order and should do so." Id.; see also Collins v. State, 240 S.W.3d 925, 928 (Tex.Crim.App.2007) ("An incorrect calculation of the amount of back-time awarded to a defendant, or the omission of any statutory back-time in the judgment can be adjusted by a motion for judgment nunc pro tunc").[1] The court has similarly held that a defendant may seek mandamus challenging a trial court's denial of or refusal to rule on a motion for a nunc pro tunc order to add back-time. See Ybarra, 149 S.W.3d at 149.
The State does not dispute Gomez's proof that he served a total of 79 days in Hays County Jail between his arrest and sentencing. Instead, it argues that "[b]ecause this is a plea bargain case, it is controlled by Collins v. State." In Collins, the defendant entered a plea agreement regarding drug possession charges in which he explicitly agreed to five years' confinement with 34 days of pre-sentence back-time. The trial court accepted the plea and entered judgment tracking those terms. After the trial court's plenary power had expired, Collins obtained a nunc pro tunc order from the trial court granting him an additional 271 days of *265 back-time that he had accrued while in custody prior to sentencing. The State appealed, and the court of appeals reversed. Collins then appealed to the court of criminal appeals, which affirmed the court of appeals. See Collins, 240 S.W.3d at 926-28.
The court of criminal appeals emphasized the general principles that a nunc pro tunc order is appropriate for fixing clerical errors in the record as to the judgment the trial court actually rendered, not errors that were the result of judicial reasoning, and that it cannot be used to "change a court's records to reflect what [the trial court] believes should have been done." Id. at 928 (citing Ex parte Poe, 751 S.W.2d 873, 876 (Tex.Crim.App. 1988) and Ex parte Dopps, 723 S.W.2d 669, 671 (Tex. Crim.App.1986)). It observed that, consequently, "before a judgment nunc pro tunc may be entered, there must be proof that the proposed judgment was actually rendered or pronounced at an earlier time." Id. (citing Wilson v. State, 677 S.W.2d 518, 521 (Tex.Crim.App.1984)). From the record in Collins, the court of criminal appeals concluded, "[i]t is clear ... that there was no clerical error that this judgment nunc pro tunc was correcting. The judge exercised judicial reasoning when he chose to accept the recommendation of the State and allow the terms of the plea bargain to control, and he entered judgment in accordance with these terms." Id. "Therefore," the court reasoned, "a judgment nunc pro tunc is not the proper remedy for the failure to award additional back-time in this circumstance." Id.
The court of criminal appeals distinguished the Ybarra line of cases regarding back-time on the basis that "in this case, there is a controlling plea bargain." Id. at 929. It noted that in Ex parte Olivares, 202 S.W.3d 771 (Tex.Crim.App.2006), it had recognized that a defendant could affirmatively waive his right to pre-sentence back-time credit by entering into a plea bargain "if the facts on record support that a waiver occurred." Collins, 240 S.W.3d at 929. The Collins court reasoned:
The question before this court now is not whether Appellee affirmatively waived his rights to the back-time credit, nor is there even an assertion that the plea bargain was not entered into knowingly and voluntarily. An appeal from a judgment nunc pro tunc would not be the correct procedure for deciding such an issue. However, the ability of a defendant to enter into a plea bargain and waive his right to back-time is important because it demonstrates that Appellee did not have a clear automatic legal right to the pre-sentence credit. As explained above, the act of accepting the recommendation of the State in a plea bargain required the judge to exercise judicial discretion, and when granting the judgment nunc pro tunc, the judge employed judicial reasoning when determining whether he was bound by the terms of the plea bargain. This was not simply a miscalculation in the number of days of back-time to be awarded, or a mistake in the transcription of the judgment into the court records. Each judge had to make specific determinations as to what Appellee was entitled, and therefore, no ministerial act was implicated.
Id. On the other hand, the court of criminal appeals emphasized some limitations on these concepts. It observed, "[i]f appellant had negotiated to receive this [award of additional back-time credit], then entry of the final calculation of back-time could have been accomplished by judgment nunc pro tunc." Id. Further, the court stressed, "if the amount of pre-sentence jail-time was not a negotiated term of a plea bargain, the statute would apply and the defendant would be entitled *266 to all statutory back-time." It was "[b]y accepting the plea bargain with 34 days of credit, Appellee waived his statutory right to the time served." Id.
Here, the State urges that "[a]s in Collins, our judgment perfectly matches the plea bargain agreement" because neither included a specific reference to back-time credit. The State characterizes the plea agreement as waiving Gomez's back-time, arguing that "[w]hen Relator accepted the plea, there was no mention of the possibility of additional back-time credit. If Relator had negotiated to receive his back-time, then entry of the final calculation could have been accomplished by a judgment nunc pro tunc. Relator signed the very page that reflected no back time."
Gomez responds that while Collins "has injected some confusion into nunc pro tunc practice," it is limited to cases where "the record affirmatively reflects a waiver of time credits, a defendant is entitled to all the time spent in jail between arrest and sentencing." He points out that the Collins court acknowledged that "if the amount of pre-sentence jail-time was not a negotiated term of a plea bargain, the statute would apply and the defendant would be entitled to all statutory back-time." Id. Where, as here, the plea agreement is simply silent as to the amount of back-time credit, Gomez urges, he "cannot be said to have waived statutory back time and the `judicial reasoning' involved in accepting the plea bargain does not preclude correction of the judgment by nunc pro tunc order." See id. We agree with Gomez.
Unlike the situation in Collins, which involved a plea agreement specifying an amount of back-time credit, Gomez's plea agreement did not address, one way or the other, whether Gomez was to receive back-time or how much. Although the parties specified certain other terms elicited in the Plea Bargain Agreement form, the parties left blank the spaces concerning back-time, and "certif[ied] that ... the agreement contains ALL the terms of the plea agreement to which they have agreed." Thus, by its express terms, Gomez's written plea agreement did not address whether he was to receive back-time or how much. Contrary to the State's arguments, the rationale of Collins, as the court of criminal appeals made clear, does not extend to cases, like this one, where "the amount of pre-sentence jail-time was not a negotiated term of a plea bargain." Id. In such instances, the court emphasized, "the statute would apply and the defendant would be entitled to all statutory back-time." Id.
Accordingly, we conditionally grant Gomez's petition for writ of mandamus and direct the district court to vacate its order denying Gomez's motion for judgment nunc pro tunc and to enter a judgment nunc pro tunc awarding Gomez credit for the amount of time he served prior to sentencing. The writ will issue only if the district court fails to take appropriate action in accordance with this opinion.
NOTES
[1]  In fact, the high court has emphasized that nunc pro tunc is the only means by which a defendant can obtain relief from the omission of back-time credit from a judgment, at least until the defendant is confined beyond his correct maximum discharge date. See Ex parte Deeringer, 210 S.W.3d 616, 617-18 & n. 7 (Tex.Crim.App.2006) (explaining that such a complaint would be cognizable in a habeas application only if the applicant alleges that he is being illegally confined past his maximum discharge date because the trial court failed to grant him the correct amount of pre-sentence credit).
