
25 P.3d 886 (2001)
2000 MT 100
STATE of Montana, Plaintiff and Respondent,
v.
Charles Rockwood HORTON, Defendant and Appellant.
No. 99-650.
Supreme Court of Montana.
Submitted on Briefs May 25, 2000.
Decided June 12, 2001.
Kevin S. Brown, Paoli & Brown, Livingston, MT, for Appellant.
Joseph P. Mazurek, Montana Attorney General, Tammy K. Plubell, Assistant Montana *887 Attorney General, Helena, MT; Tara DePuy, Park County Attorney, Livingston, MT, for Respondent.
Justice JAMES C. NELSON delivered the Opinion of the Court.
¶ 1 Charles Rockwood Horton (Horton) was convicted in the Sixth Judicial District Court, Park County, of felony DUI and driving while his license was suspended. Horton appeals the District Court's sentencing order requiring him to pay his child support obligation, including an arrearage, and failing to award Horton credit for time already served. We reverse.
¶ 2 Horton raises the following issues on appeal:
¶ 3 1. Whether the District Court exceeded its statutory authority by ordering Horton to pay restitution for a dismissed count.
¶ 4 2. Whether the District Court abused its discretion by ordering Horton to pay restitution without first considering his financial resources and future ability to pay.
¶ 5 3. Whether the District Court erred when it failed to credit Horton with time served in its written judgment after having allowed the credit in its oral pronouncement of sentence.
¶ 6 Because we hold in issue 1 that the District Court exceeded its statutory authority by ordering Horton to pay restitution for a dismissed count, it is unnecessary for us to address the question in issue 2 of Horton's ability to pay said restitution.

Factual and Procedural Background
¶ 7 On the night of June 10, 1999, Horton was pulled over by law enforcement officers for driving erratically. One of the officers approached Horton's vehicle and, when Horton rolled down the driver's side window, the officer noticed the strong odor of alcohol. The officer asked Horton to exit the vehicle, but when Horton did so, he nearly fell over. Horton was then placed under arrest for suspicion of driving under the influence (DUI) and transported to the Park County detention center. At the detention center, Horton refused to undergo any tests. A search of Horton's driving record revealed that he had nine prior DUI convictions.
¶ 8 A further search of Horton's records revealed that he owed more than $47,000 in back child support. When his divorce decree was entered in 1988, Horton was ordered to pay $350 per month in child support. On November 14, 1996, Horton's monthly child support obligation was increased to $393 per month by administrative order. Horton failed to pay his support obligation, however, and on April 23, 1999, the Child Support Enforcement Division (CSED) sent him a letter giving him until May 14, 1999, to begin making monthly child support payments and to make payment arrangements for the arrearage. Horton refused to comply. As of June 1999, Horton's support obligation amounted to $49,867. Horton involuntarily paid $2,477 as a result of CSED's interception of a tax refund. Thus, Horton owed $47,390 in child support dating back to 1988, and his current support obligation was fixed at a rate of $393 per month.
¶ 9 At the time of his arrest on these latest offenses, Horton was already serving a suspended sentence for a June 1997 felony DUI conviction. He had only 26 days left on this suspended sentence when he committed the current offenses. On June 21, 1999, the Park County Attorney filed a petition to revoke Horton's suspended sentence. The petition also alleged that Horton had violated his sentence by failing to pay fines and supervision fees and for failing a drug test.
¶ 10 On June 28, 1999, the Park County Attorney charged Horton by Information with the commission of four offenses: driving under the influence of alcohol, a felony, in violation of §§ 61-8-401 and 61-8-731, MCA; driving while license suspended or revoked, a misdemeanor, in violation of § 61-5-212, MCA; habitual traffic offender operating a motor vehicle, a misdemeanor, in violation of § 61-11-213, MCA; and nonsupport, a felony, in violation of § 45-5-621, MCA. On July 6, 1999, Horton appeared with his counsel and pleaded not guilty to all of the charges. The District Court remanded Horton to the custody of the Park County Jail.
¶ 11 Horton and the Park County Attorney executed a written plea agreement on *888 August 13, 1999, wherein Horton agreed to plead guilty to the traffic offenses and the County Attorney agreed to dismiss the felony nonsupport charge. As part of the terms and conditions for dismissing the felony nonsupport charge, the County Attorney agreed to recommend a sentence of 13 months with the Department of Corrections, to be served in a pre-release program, followed by four years of probation. The plea agreement also listed the following as part of the terms and conditions of the probationary sentence:
Defendant shall pay child support at the rate of $393 per month and an additional sum of $200 per month towards the arrearage. Defendant shall pay the total amount of arrearage in full sixty (60) days prior to the end of his probationary period.
¶ 12 Horton appeared before the District Court on August 16, 1999, and, pursuant to the plea agreement, he pleaded guilty to the DUI charge, the charge of driving while his license was suspended or revoked, and the charge of being a habitual traffic offender operating a motor vehicle. In addition, Horton had included the following handwritten notation above his signature line in the plea agreement:
State will not seek any additional or consecutive time from the underlying Petition to Revoke. Parties Agree that the Defendant can argue against the State's recommendations regarding fines & payment of support arrearages contained within [the plea agreement].
¶ 13 At the sentencing hearing on September 7, 1999, the District Court dismissed without prejudice the misdemeanor charge of being a habitual traffic offender because the State failed to provide proof that a valid habitual-offender designation was in place at the time of the offense. In addition, Horton's counsel informed the court that Horton objected to the court ordering him to pay any child support arrearage. Counsel argued that because the nonsupport offense had been dismissed, Horton would be paying restitution on a count for which he had not been convicted.[1] Counsel also objected to the fact that the State was seeking restitution without regard to Horton's financial resources or future ability to pay restitution.
¶ 14 Nevertheless, the District Court ordered Horton to pay his monthly child support obligation of $393 and an additional $200 per month toward the arrearage. The court sentenced Horton to 13 months at the Department of Corrections followed by four years of probation. The court expressly promised to revoke Horton's probation and give him four years in prison with no parole if he did not pay his child support as ordered.
¶ 15 Horton remained incarcerated at the Park County Jail from the time of his arrest on June 10, 1999, through his sentencing hearing on September 7, 1999. At the sentencing hearing, Horton's counsel asked if Horton would get credit for the time he served in jail. The Judge responded: "Yeah. It's automatic you get credit for time served." However, in his written sentence, the Judge refused to credit Horton for time served prior to sentencing on the basis that Horton was being held on a probation violation.
¶ 16 On appeal, Horton asks that we vacate the paragraph in the District Court's Judgment and Order of Sentence wherein the court ordered Horton to pay his child support as well as the paragraph in the judgment wherein the court ordered that Horton not be given credit for time served prior to sentencing.

Standard of Review
¶ 17 This Court reviews a district court's imposition of a sentence for legality only. State v. Hilgers, 1999 MT 284, ¶ 6, 297 Mont. 23, ¶ 6, 989 P.2d 866, ¶ 6 (citing State v. Richards (1997), 285 Mont. 322, 324, 948 P.2d 240, 241). See also State v. Rennick, 1999 MT 155, ¶ 7, 295 Mont. 97, ¶ 7, 983 P.2d 907, ¶ 7; State v. Graves (1995), 272 Mont. 451, 463, 901 P.2d 549, 557. The standard of review of the legality of a sentence is whether the sentencing court abused its discretion. Rennick, ¶ 7. In reviewing the court's findings *889 of fact as to the amount of restitution, our standard of review is whether those findings are clearly erroneous. Hilgers, ¶ 6 (citing State v. Perry (1997), 283 Mont. 34, 36, 938 P.2d 1325, 1327).

Issue 1.

¶ 18 Whether the District Court exceeded its statutory authority by ordering Horton to pay restitution for a dismissed count.

¶ 19 Horton argues that the District Court abused its discretion and exceeded statutory mandates when it ordered him to pay restitutionthe child support arrearagefor an offense which was dismissed and for which he was never convictedthe felony nonsupport charge. Horton maintains that through the handwritten addendum to the plea agreement, he reserved his right to object to any award of restitution for the dismissed count. Hence, he argues that there was no agreement between himself and the State obligating him to pay such restitution.
¶ 20 Horton also argues that under State v. Brown (1994), 263 Mont. 223, 867 P.2d 1098, restitution is statutorily limited to the "victim" of the crime. Thus, Horton maintains that Montana's statutory mandates would allow the District Court to order restitution for any victim who sustained pecuniary or economic loss as a result of the crimes for which he was convicted. But, since he was convicted of felony DUI and driving without a valid license and there were no victims sustaining pecuniary or economic loss as a result of those crimes, Horton argues that restitution was inappropriate in this case.
¶ 21 The State argues on the other hand that, as a result of the handwritten notation, Horton is attempting to receive the benefit of the plea agreementhaving a felony charge against him dismissedwithout holding up his end of the bargainpaying his child support obligation including the arrearage. At the sentencing hearing, when Horton's counsel informed the court that Horton objected to paying any child support arrearage because Horton had not been convicted of the charge of nonsupport, the Park County Attorney stated:
The only reason that that count was dismissed is because there were negotiations between defense counsel and myself that the State would dismiss if the defendant paid child support. If that is not the agreement then the State wants to withdraw.
¶ 22 The State also contends that Horton's argument at the sentencing hearing that his handwritten notation was his clearly expressed refusal to pay child support is flawed because the notation does not state that he contests paying any of the support arrearage, but rather that he could contest the amount of the arrearage owing. The State further contends that the notation only refers to the arrearage to be paid at the rate of $200 per month and not to Horton's regular child support obligation of $393 per month.
¶ 23 A plea agreement is a contract which is subject to contract law standards. State v. Keys, 1999 MT 10, ¶ 18, 293 Mont. 81, ¶ 18, 973 P.2d 812, ¶ 18 (citing State v. Butler (1995), 272 Mont. 286, 291, 900 P.2d 908, 911). Under contract law, one party relinquishes some rights in reliance upon the promise of the other party. In this case, the plea agreement sets forth in a straightforward manner that the State agreed to dismiss the charge of felony nonsupport and recommend a probationary sentence upon the condition that Horton make his monthly child support payment of $393, as well as a payment of $200 per month to apply to the arrearage. This Court has consistently held that it will not assist a defendant in escaping the obligations of his plea agreement once he has received its benefit. Keys, ¶ 19 (citing State v. Nance (1947), 120 Mont. 152, 166, 184 P.2d 554, 561).
¶ 24 However, it is also well established that a district court's authority to impose sentences in criminal cases is defined and constrained by statute. State v. Nelson, 1998 MT 227, ¶ 24, 291 Mont. 15, ¶ 24, 966 P.2d 133, ¶ 24 (citing State v. Wilson (1996), 279 Mont. 34, 37, 926 P.2d 712, 714). Moreover, "a district court has no power to impose a sentence in the absence of specific statutory authority." Nelson, ¶ 24 (quoting State v. Hatfield (1993), 256 Mont. 340, 346, 846 P.2d 1025, 1029).
¶ 25 The statutory authority for the payment of restitution is found at § 46-18-201(2), *890 MCA (1997),[2] which provides in pertinent part as follows:
In addition to any penalties imposed pursuant to subsection (1), if the court finds that the victim of the offense has sustained a pecuniary loss, the court shall require payment of full restitution to the victim as provided in XX-XX-XXX through XX-XX-XXX.
On that basis, restitution is, as Horton argued, statutorily limited to the "victim" of the crime for which a defendant is convicted. Brown, 263 Mont. at 227, 867 P.2d at 1101.
¶ 26 The State argues that under State v. Shaver (1988), 233 Mont. 438, 449, 760 P.2d 1230, 1237, "child support obligations are a legitimate condition to be considered as part of probation." However, unlike the case before us, Shaver's two children were the victims of the crimes for which Shaver was convicted. Moreover, there was no contention in Shaver that child support for the victims was not related to the crimes charged, hence we did not directly address that issue.
¶ 27 In the present case, Horton pleaded guilty to felony DUI and misdemeanor driving without a license. He did not plead guilty to, nor was he convicted of, the charge of felony nonsupport. Hence, there was no "victim" of the crimes for which Horton was convicted and to whom Horton could be ordered to pay restitution.
¶ 28 The State also argues that under § 46-18-202(1)(e), MCA (1997), ordering Horton to pay his child support was proper because a sentencing court may impose any condition or restriction "reasonably related to the objectives of rehabilitation and the protection of the victim and society." However, in interpreting that provision of § 46-18-202(1)(e), MCA (1997), in State v. Ommundson, 1999 MT 16, ¶ 11, 293 Mont. 133, ¶ 11, 974 P.2d 620, ¶ 11, we held that a sentencing limitation or condition must have some correlation or connection to the underlying offense for which the defendant is being sentenced. There is no such correlation or connection in this case between Horton's conviction on the DUI charge and ordering Horton to pay his child support. Consequently, the District Court's order did not meet the statutory requirements for the imposition of restitution on a suspended sentence.[3]
¶ 29 Accordingly, we hold that the District Court exceeded its statutory authority by making the payment of Horton's child support obligation a condition of his sentence. Hence, the provision in paragraph I(M) in the court's Judgment and Order of Sentence ordering Horton to pay his child support should be stricken.

Issue 3.
¶ 30 Whether the District Court erred when it failed to credit Horton with time served in its written judgment after having allowed the credit in its oral pronouncement of sentence.
¶ 31 Horton was incarcerated at the Park County Jail from the time of his arrest *891 on June 10, 1999, until his sentencing on September 7, 1999. At the sentencing hearing, Horton's counsel asked the Judge if Horton would get credit for time served. The Judge responded: "Yeah. It's automatic you get credit for time served." However, the written judgment and sentence entered two days later stated: "Defendant shall not be given credit for time served prior to sentencing as he was being held on a probation violation."
¶ 32 Horton argues on appeal that the District Court erred in issuing a written sentence refusing to grant him credit for time served when the Judge specifically stated at the sentencing hearing that Horton would get credit for the time he served in the Park County Jail. In its brief on appeal, the State concedes that Horton is entitled to credit for the time he served between his arrest and his sentencing pursuant to § 46-18-403, MCA, which provides:
(1) Any person incarcerated on a bailable offense and against whom a judgment of imprisonment is rendered must be allowed credit for each day of incarceration prior to or after conviction, except that the time allowed as a credit may not exceed the term of the prison sentence rendered.
¶ 33 Moreover, the State concedes that under the principle set forth in State v. Lane, 1998 MT 76, 288 Mont. 286, 957 P.2d 9, the District Court's oral pronouncement that Horton receive credit for time served controls over the court's written pronouncement that Horton was not entitled to credit for time served. We held in Lane that "the sentence orally pronounced from the bench in the presence of the defendant is the legally effective sentence and valid, final judgment." Lane, ¶ 40.
¶ 34 Accordingly, we hold that based upon § 46-18-403(1), MCA, and our holding in Lane, the sentence the District Court orally pronounced from the bench in Horton's presence is the "legally effective sentence." Hence, the provision in paragraph II of the court's Judgment and Order of Sentence stating that Horton will not receive credit for time served, should be stricken.
¶ 35 Reversed.
KARLA M. GRAY, C.J., and TERRY N. TRIEWEILER and JIM REGNIER, JJ., concur.
Justice PATRICIA O. COTTER specially concurs and dissents.
¶ 36 I concur with the Court's conclusion that a district court's authority to impose sentences in criminal cases is defined and constrained by statute, and I agree with the Court's conclusion that there was no victim of the crimes for which Horton was convicted and to whom Horton could be ordered to pay restitution over objection. However, I dissent from the Court's order striking the provision in Paragraph I(M) in the Court's Judgment and Order of Sentence.
¶ 37 The majority correctly concludes that a plea agreement is a contract which is subject to a contract law analysis. Under contract law, one party relinquishes a right or receives a benefit in reliance upon the promises of the other party. Here, as the State points out, a plea agreement was negotiated whereby Horton was relieved of a conviction of felony nonsupportwhich under the circumstances of this case was inevitablein exchange for his agreement to pay child support. The State's forbearance was given in exchange for the defendant's agreement to pay back support prior to the end of his probationary term. That requirement of the plea agreement has now been stricken. Thus, the quid pro quo of the plea agreement has been undone by this Court's decision.
¶ 38 If we proceed in subsequent cases as we have here, at some point after the plea agreement is signed and sealed, we will strike what we deem to be the offending condition upon complaint by the defendant, leaving the balance of the agreement in place. In so doing, we will leave prosecutors without the benefit of their bargain, and without the opportunity to undo the bargain the benefit of which has been stripped away. Prosecutors will conclude, and understandably so, that it is not in the State's best interests to negotiate a global resolution of multiple pending charges in one plea agreement, because, even if the defendant agrees to the deal, he can have it undone, to his sole benefit, after sentencing. Such a fundamental *892 change in the way of doing business will disadvantage both the State and the defendant. It will result in fewer plea agreements, more litigation, and increased congestion in the courts, not to mention a flood of appeals arising from past pleas, wherein the defendant agreed to a condition unrelated to the charge of which he was convicted, as part of what was, until now, considered a valid and enforceable plea agreement.
¶ 39 As stated above, I do not dispute the underlying legal conclusions reached here. However, because I see value in the continuing use of global plea agreements that are bargained for equally, and because I think the State is entitled to the benefit of its bargain, I would hold that, in the event a defendant seeks to vacate a central provision of a plea agreement on the grounds that the court was without authority to impose a condition unrelated to the offense to which the defendant ultimately pled guilty, then the district court should in turn give the State the option to either accept the plea agreement as revised, or rescind the agreement under § 28-2-1711, MCA, and § 28-2-1714, MCA, for failure of consideration. If the State elects to rescind, the parties would then be returned to their pre-plea agreement positions, with the defendant withdrawing his plea of guilty and the previously dismissed charges being reinstated by the State. Thereafter, the parties could either negotiate a new plea agreement or proceed to trial.
¶ 40 Applying principles of contract law, we recently held that a non-breaching defendant party to a plea agreement, when confronted with the breach of a condition of the plea agreement by the State, should have the right to choose from the available remedies of rescission of the plea agreement or specific performance. State v. Munoz, 2001 MT 85, ¶¶ 16-19, 305 Mont. 139, ¶¶ 16-19, 23 P.3d 922. I see no reason why the State should be afforded less latitude when the defendant seeks to invalidate a material term of a negotiated plea agreement, resulting in a similar failure of consideration.
Justice W. WILLIAM LEAPHART joins in the foregoing special concurrence and dissent.
Chief Justice KARLA M. GRAY specially concurring.
¶ 41 I have signed, and join in, the Court's opinion in its entirety. I write separately only to comment on Justice Cotter's thoughtful concurring and dissenting opinion.
¶ 42 I agree with much of Justice Cotter's opinion. In particular, I agree with those portions of her opinion which discuss the importance to both prosecutors and criminal defendants of the availability of plea agreements. I would add to Justice Cotter's concerns another one of critical importance: the State's efforts to enforce child support orders and collect ordered support by any legal means.
¶ 43 I cannot agree, however, with Justice Cotter's conclusion that the State is entitled to the benefit of its bargain in the present case. Prosecutors are aware that sentencing courts are bound by statutory parameters in Montana which essentially define legal sentences. Prosecutors also know, or should have known soon after February 3, 1999, the date on which we decided Ommundson, that a sentencing limitation or condition must have some correlation or connection to the underlying offense for which the defendant is being sentenced.
¶ 44 Here, the plea agreement between the prosecutor and Horton was executed on August 13, 1999, more than six months after Ommundson's holding that sentencing conditions must relate to the underlying offense for which a sentence is to be imposed. At that point, the prosecutor had no entitlement to benefit from a bargain which would require the District Court to impose an illegal sentence. Under different circumstances than those presented here, a remand might well be appropriate. Where, however, as here, the State is not entitled to the benefit of a bargain which included a condition which would render the sentence unlawful, it is my view that our only legitimate choicelike it or notis to strike the offending condition. For that reason, I join the Court in doing so.
NOTES
[1]  Section 45-5-621(10), MCA, provides that the arrearages payable under a support order are considered restitution and the terms for payment of such restitution must be determined by the court.
[2]  The District Court entered its Judgment and Order of Sentence in the case sub judice on September 9, 1999. While the 1999 Legislature extensively amended § 46-18-201, MCA, the majority of those amendments did not take effect until October 1, 1999, three weeks after Horton was sentenced.
[3]  Due to an apparent codification error, under the version of the statute effective October 1, 1999, a district court can only require restitution in cases involving deferred imposition of sentence and not in cases involving suspended execution of sentence. Prior to the 1999 amendments to § 46-18-201, MCA, subsection (1)(a) referred to deferred imposition of sentence and subsection (1)(b) referred to suspended execution of sentence. Subsection (2) of the statute authorized the sentencing court to require payment of restitution. Subsection (2) stated:

In addition to any penalties imposed pursuant to subsection (1), if the court finds that the victim of the offense has sustained a pecuniary loss, the court shall require payment of full restitution to the victim as provided in XX-XX-XXX through XX-XX-XXX. [Emphasis added.]
When the 1999 Legislature amended § 46-18-201, MCA, it renumbered portions of the statute. While a deferred imposition of sentence is still discussed in subsection 1, suspended execution of sentence is now discussed in subsection (2). However, the Legislature did not amend the subsection on restitution. That subsection still states: "In addition to any penalties imposed pursuant to subsection (1) ...." Section 46-18-201(5), MCA (1999) (emphasis added). Hence, under this statute, a district court can only require restitution in cases involving deferred imposition of sentence and not in cases involving suspended execution of sentence.
