
738 P.2d 1182 (1987)
The PEOPLE of the State of Colorado, Plaintiff-Appellant,
v.
Matthew Dean APPELHANZ, Defendant-Appellee.
No. 85SA240.
Supreme Court of Colorado, En Banc.
June 22, 1987.
*1183 Stephen K. ErkenBrack, Dist. Atty., Thomas W. Blake, Chief Deputy Dist. Atty., Grand Junction, for plaintiff-appellant.
Woodrow, Roushar & Carey, Margaret L. Carey, Montrose, for defendant-appellee.
VOLLACK, Justice.
The People appeal from an order of deferred judgment and sentence entered by the trial court, which was imposed on the defendant after he entered a guilty plea pursuant to a plea agreement. We reverse, and remand for resentencing.

I.
In September 1984, the defendant was arrested and found to be in possession of a small amount of cocaine. A criminal complaint was filed charging the defendant with possession of a schedule II controlled substance (a class 3 felony), in violation of section 12-22-310, 5 C.R.S. (1985)[1]; and section 18-18-105, 8B C.R.S. (1986).[2] The county court judge found probable cause at the preliminary hearing, and the case was bound over.
On April 5, 1985, the defendant and prosecutor entered into a plea agreement. In exchange for the defendant's guilty plea, the prosecutor amended the possession charge to the lesser offense of use of a schedule II controlled substance, a class 5 felony. § 18-18-104, 8B C.R.S. (1986).[3] The plea agreement did not include any stipulations by the parties, or sentencing concessions by the district attorney.
A sentencing hearing was held three months later. After hearing testimony and reviewing the presentence report, the trial judge ruled that a deferred judgment and sentence was appropriate. He ordered that the defendant's judgment and sentence be deferred for six months. The district attorney, who had not agreed to a deferred judgment and sentence, entered a contemporaneous objection and noted her lack of consent on the record. The judge stated that he would order the deferred judgment and sentence, regardless of the district attorney's objection. The court stayed its order pending appeal.
The People bring this appeal from the trial court's order, and we are asked to determine whether the court's order of deferred *1184 judgment and sentence, over the prosecutor's objection, was erroneous.

II.
Because there was no written stipulation for a deferred judgment and sentence prior to the defendant's entry of a guilty plea, the controlling statutory provision is section 16-7-403(1), which states in pertinent part:
Deferred sentencing of defendant. (1) In any case in which the defendant has entered a plea of guilty, the court accepting the plea has the power, with the written consent of the defendant and his attorney of record and the district attorney, to continue the case for a period not to exceed two years from the date of entry of such plea for the purpose of entering judgment and sentence upon such plea of guilty.
§ 16-7-403(1), 8A C.R.S. (1986) (emphasis added).[4] In contrast, subsection (2) of the same statute governs deferred sentencing when the defendant and the district attorney have entered into a written stipulation prior to the defendant's entry of a guilty plea.[5]
The language of subsection (1) expressly requires "the written consent of the defendant and his attorney of record and the district attorney." The court's power to continue the case is conditioned on this written consent.
The rule is that "[a] court may not impose a sentence that is inconsistent with the terms specified by statutes." People v. District Court, 673 P.2d 991, 995 (Colo. 1983). "Legislative intent is the fundamental guide" in statutory interpretation. People v. Mascarenas, 706 P.2d 404, 406 (Colo. 1985). To determine legislative intent, a court is required to look first to the statutory language, and words and phrases are to be given their plain and obvious meaning. People v. District Court, 713 P.2d 918, 921 (Colo.1986). "If the language is clear and the intent appears with reasonable certainty, there is no need to resort to other rules of statutory construction," and the statute should be given effect as written. Id. See People v. Macias, 631 P.2d 584, 587 (Colo.1981) (where statute's application is clear on its face, trial court cannot impose sentence contrary to the statute).
The language of section 16-7-403 is clear and specific; there is no ambiguity as to the General Assembly's intent. Where the parties have entered into a stipulation or written agreement prior to entry of the defendant's guilty plea, subsection (2) controls. Where there is no prior agreement, the statute expressly conditions the court's power to enter a deferred judgment and sentence on the written consent of the defendant, defense counsel, and the district attorney. Where either of the parties object, the court does not have the power to enter the deferred sentence and judgment. "A court may not ignore a legislative mandate and impose what it considers to be a more appropriate sentence." People v. White, 679 P.2d 602, 604 (Colo.1984) (judge cannot circumvent legislative sentencing mandate by suspending part of a mandatory sentence).

III.
The defendant entered his plea of guilty three months prior to the sentencing hearing. The plea agreement, which was made part of the record, expressly stated that no sentencing concessions were made. The *1185 statute requires the consent of the district attorney, as well as the consent of the defendant and his attorney, before the court has power to order a deferred judgment and sentence. There is no dispute that the district attorney did not consent; she objected on the record at the hearing.
The defendant contends that we should characterize the trial court's action as a grant of probation, and find the sentence to be legal under the general probation statute, section 16-11-202, 8A C.R.S. (1986).[6] We decline to adopt this reasoning.
At the sentencing hearing, the judge noted the small amount of cocaine, the "somewhat insignificant" circumstances surrounding the offense, and the non-aggravated nature of the case in concluding that "deferred judgment and sentence is, therefore, considered by me to be the appropriate resolution of this matter." The judge made specific reference to "16-7-403, which is the deferred judgment and sentence statute," and set out pertinent provisions of the statute on the record. Finally, he ruled that "I am going to order that he be placed on deferred judgment and sentence." Nothing in the record supports the defendant's contention that the trial court did not understand that it was imposing a deferred judgment and sentence under § 16-7-403. See People v. Washington, 709 P.2d 100 (Colo.App.1985) (if defendant is ineligible for probation, a sentencing court cannot in effect grant probation "under the guise of `staying' or suspending imposition of the sentence and then imposing probation-like conditions." Id. at 102.).
The defendant mistakenly relies on People v. Ray, 192 Colo. 391, 560 P.2d 74 (1977). In Ray, we held that the broad language of section 16-11-202, granting probationary power to the court, also encompassed the court's power to enter a deferred judgment. Id. at 393, 560 P.2d at 76. The deferred judgment and sentence in Ray was the product of a written plea bargain signed by the district attorney and the defendant. When the defendant violated the conditions of the plea bargain, the deferred judgment was revoked and he was sentenced to the state reformatory. These proceedings took place before the legislature's enactment of section 16-7-403, which now governs imposition of a deferred judgment and sentence. The defendant's reliance on Ray is misplaced for three reasons. First, the facts in Ray involved a written plea agreement, entered into with the district attorney's consent. Id. at 392, 560 P.2d at 75. No such agreement exists in the case at bar. Second, section 16-7-403 became effective after the trial court in Ray granted probation and entered the deferred judgment. Id. at 393, 560 P.2d at 75. Third, we overruled Ray in People v. District Court, 673 P.2d 991 (Colo.1983) (holding in Ray, that a sentencing court's probationary power authorized granting of a deferred judgment, in absence of statute, is overruled "to the extent that [it] may be read contrary" to this opinion. Id. at 996).
Accordingly, we reverse the trial court's order and remand for resentencing by the trial court.
NOTES
[1]  Section 12-22-310(1)(a)(V) classifies coca leaves and related substances and derivatives as schedule II controlled substances. 5 C.R.S. (1985).
[2]  Section 18-18-105(1)(a) and (2)(a)(I), 8B C.R.S. (1986), reads as follows:

Unlawful distribution, manufacturing, dispensing, sale, or possession. (1)(a) Except as authorized by part 3 of article 22 of title 12, C.R.S., it is unlawful for any person knowingly or intentionally to manufacture, dispense, sell, or distribute, with or without remuneration, to possess, or to possess with intent to manufacture, dispense, sell, or distribute, with or without remuneration, a controlled substance; or to induce, attempt to induce, or conspire with one or more other persons tomanufacture, dispense, sell, or distribute, with or without remuneration, or to possess with intent to manufacture, dispense, sell, or distribute, with or without remuneration, a controlled substance.
....
(2) Except as is otherwise provided for offenses concerning marihuana and marihuana concentrate in section 18-18-106, any person who violates any of the provisions of subsection (1) of this section:
(a) In the case of a controlled substance listed in schedule I or II of part 3 of article 22 of title 12, C.R.S., commits:
(I) A class 3 felony....
[3]  Section 18-18-104(1)(a), 8B C.R.S. (1986), reads as follows:

Unlawful use of a controlled substance. (1) Except as is otherwise provided for offenses concerning marihuana and marihuana concentrate in section 18-18-106, any person who uses any controlled substance, except when it is dispensed by or under the direction of a person licensed or authorized by law to prescribe, administer, or dispense such controlled substance for bona fide medical needs, commits:
(a) A class 5 felony, if the controlled substance is listed in schedule I or II of part 3 of article 22 of title 12, C.R.S.
[4]  A portion of the statute governing time limits that apply when restitution is ordered was amended in 1985. The amendment does not affect these proceedings. See 1985 Colo. Sess. Laws 617, 1371.
[5]  Section 16-7-403(2) states:

Prior to entry of a plea of guilty to be followed by deferred judgment and sentence, the district attorney, in the course of plea discussion... is authorized to enter into a written stipulation, to be signed by the defendant, his attorney of record, and the district attorney, under which the defendant obligates himself to adhere to such stipulation.... Upon full compliance with such conditions by the defendant, the plea of guilty previously entered shall be withdrawn and the action against the defendant dismissed with prejudice. Such stipulation shall specifically provide that, upon a breach by the defendant of any condition regulating the conduct of the defendant, the court shall enter judgment and impose sentence upon such guilty plea.
8A C.R.S. (1986).
[6]  Section 16-11-202 states:

Probationary power of court. When it appears to the satisfaction of the court that the ends of justice and the best interest of the public, as well as the defendant, will be served thereby, the court may grant the defendant probation for such period and upon such terms and conditions as it deems best. § 16-11-202, 8A C.R.S. (1986).
