
83 Wn.2d 188 (1973)
517 P.2d 192
THE STATE OF WASHINGTON, Petitioner,
v.
DARRELL LEE PRINGLE et al., Respondents.
No. 42819.
The Supreme Court of Washington, En Banc.
December 20, 1973.
Christopher T. Bayley, Prosecuting Attorney, and Charles J. Delaurenti II, Deputy, for petitioner.
Peter Berzins and Robert T. Czeisler, for respondents.
HUNTER, J.
This case involves a petition for writ of mandamus brought by the plaintiff (petitioner), State of Washington, to require a trial judge at a sentencing hearing to enter a special finding of fact that the defendant (respondent), Darrell Lee Pringle, was armed with a deadly *189 weapon and firearm during the commission of a robbery for which he entered a plea of guilty.
On March 9, 1973, the defendant and another were charged by amended information in the Superior Court for King County with three counts of robbery while armed with a deadly weapon (as defined by RCW 9.95.040) and a firearm (pursuant to RCW 9.41.025). On March 30, 1973, the defendant, represented by counsel, entered a plea of guilty to count 1 of the information, and counts 2 and 3 of the information were dismissed by the court upon motion by the plaintiff. At this time the trial court advised the defendant of the consequences of entering a plea of guilty to the charge, which, because of the deadly weapon and firearm allegations, carried with it the mandatory minimum sentences imposed by RCW 9.95.040(1) and RCW 9.41.025 (1).
The sentencing hearing was held on May 3, 1973, before a judge of the superior court who did not preside over the case at the time of the entry of the plea. At the hearing it was disclosed that the 36-year-old defendant had no prior felonies on his record and had committed only two misdemeanor offenses of vagrancy and minor consumption of alcohol. After considering the arguments of counsel, the sentencing judge deleted the language in the finding portion of the judgment and sentence, referring to "armed with a deadly weapon, to wit: a firearm" upon the theory that he was acting within the court's power under RCW 10.46.090. At the same time the sentencing judge refused to enter the special finding of fact pursuant to RCW 9.95.015 as to whether or not the defendant was armed with a deadly weapon at the time of the commission of the crime, and sentenced the defendant to imprisonment for the crime of robbery for a maximum term of 20 years.
On May 16, 1973, the plaintiff filed an application for a writ of mandamus with this court to compel the sentencing judge to enter the special finding of fact pursuant to RCW 9.95.015, or to have this court enter an order making such a finding. At a preliminary hearing held on June 28, 1973, we *190 ordered the matter be set for a full hearing, and stayed the determination of the duration of confinement by the Board of Prison Terms and Paroles. Meanwhile, on July 2, 1973, the Board of Prison Terms and Paroles, apparently unaware of the stay order, set the minimum term of the defendant at 5 years.
[1, 2] The plaintiff's first contention before this court is that the sentencing judge had no authority under RCW 10.46.090[1] to strike the language referring to "armed with a deadly weapon, to wit: a firearm" from the judgment and sentence when the defendant had entered a valid plea of guilty to the allegations in the information. We agree. The statute upon which the sentencing judge relied provides as follows:
The court may, either upon its own motion or upon application of the prosecuting attorney, and in furtherance of justice, order any criminal prosecution to be dismissed; but in such case the reason of the dismissal must be set forth in the order, which must be entered upon the record. No prosecuting attorney shall hereafter discontinue or abandon a prosecution except as provided in this section.
RCW 10.46.090.
Pursuant to this statute, the sentencing judge reasoned that it was within the power of the court to delete the language in question from the judgment and sentence "in furtherance of justice." This statute, however, relates to the dismissal of a "criminal prosecution" and in no way authorizes a sentencing judge to modify a criminal information after the conclusion of the prosecution and after a valid plea of guilty has been entered. In entering the plea to the *191 charge in the information, the defendant admitted all the allegations therein and acknowledged full responsibility for the legal consequences of his guilt. State v. Dodd, 70 Wn.2d 513, 424 P.2d 302 (1967). This court, on prior occasions, has addressed the issue of the finality of a valid plea of guilty, and we adhere to the reasoning set forth in Woods v. Rhay, 68 Wn.2d 601, 414 P.2d 601 (1966), on page 605:
A plea of guilty to a criminal offense, if voluntarily made in open court, is a confession of guilt and the result equivalent to a conviction. Unless withdrawn before sentence is pronounced, such a plea has the same effect in law as a verdict of guilty, for nothing remains to be done save the imposition of sentence. In re Mohr v. Smith, 26 Wn.2d 188, 173 P.2d 141 (1946); In re Brandon v. Webb, 23 Wn.2d 155, 160 P.2d 529 (1945); State ex rel. Lundin v. Superior Court, 102 Wash. 600, 174 Pac. 473 (1918).
The defendant in this case does not contend that the plea was involuntarily entered or that the plea should have been set aside. Rather, the record is clear that the defendant voluntarily entered a plea of guilty to the charge of robbery "while armed with a deadly weapon and a firearm," and was properly given notice of the nature of the charge. State v. Frazier, 81 Wn.2d 628, 503 P.2d 1073 (1972); State v. Porter, 81 Wn.2d 663, 504 P.2d 301 (1972). The sentencing judge acted without jurisdiction in relying upon the authority of RCW 10.46.090 to strike the language referring to a deadly weapon and firearm from the judgment and sentence in this case where the prosecution had been terminated, and a voluntary plea of guilty had been entered by the defendant admitting all the allegations contained in the information.
[3] The plaintiff's primary contention in this case is that since the defendant pleaded guilty to the charge containing allegations of being armed with a "deadly weapon" and a "firearm," the sentencing judge had no discretion but to enter the special finding of fact requested by the plaintiff pursuant to RCW 9.95.015. We agree. That statute states the following:
In every criminal case wherein conviction would require *192 the board of prison terms and paroles to determine the duration of confinement and wherein there has been an allegation and evidence establishing that the accused was armed with a deadly weapon at the time of the commission of the crime, the court shall make a finding of fact of whether or not the accused was armed with a deadly weapon, as defined by RCW 9.95.040, at the time of the commission of the crime, or if a jury trial is had, the jury shall, if it find the defendant guilty, also find a special verdict as to whether or not the defendant was armed with a deadly weapon, as defined in RCW 9.95.040, at the time of the commission of the crime.
(Italics ours.)
In order for this statute to become operative, there must be an allegation and evidence that the accused was armed with a deadly weapon at the time of the commission of the crime. The sentencing judge in this case apparently proceeded under the theory that having stricken from the charge the language containing the allegation of a deadly weapon, he did not come within the ambit of RCW 9.95.015 requiring the special finding. This conclusion, however, was fallacious since the sentencing judge acted without authority in making this deletion from the information, and the deleted language should be reinstated. The sentencing judge, therefore, came within the requirements of RCW 9.95.015. We agree with the reasoning of the Court of Appeals, Division One, in State v. Thornton, 9 Wn. App. 699, 702, 514 P.2d 179 (1973), in which it correctly construes the mandate of this statute:
The trial court recites in its finding of fact that RCW 9.95.015 allows the exercise of discretion in whether or not a finding of fact or a special verdict will be made or returned. We disagree, holding the making of such a finding as a step in the sentencing procedure is a duty now placed upon the courts. The trier of the fact must make the finding or return the verdict if there has been an allegation and evidence establishing that the accused was armed with a deadly weapon at the time of the commission of the crime. The performance of the function is mandatory upon the court.
*193 [4] We, therefore, hold that the sentencing judge, having improperly stricken the allegations from the information and having failed to comply with the mandate of RCW 9.95.015, entered an erroneous and invalid sentence upon the defendant. In cases such as this where a trial court has erroneously sentenced an accused under the law, this court has held that returning the defendant for resentencing is an appropriate procedure. We stated in McNutt v. Delmore, 47 Wn.2d 563, 565, 288 P.2d 848 (1955), cert. denied, 350 U.S. 1002 (1956):
When a sentence has been imposed for which there is no authority in law, the trial court has the power and duty to correct the erroneous sentence, when the error is discovered. This does not, of course, affect the finality of a correct judgment and sentence that was valid at the time it was pronounced.
Accord, State v. Loux, 69 Wn.2d 855, 420 P.2d 693 (1966), cert. denied, 386 U.S. 997 (1967); State v. Wells, 7 Wn. App. 553, 500 P.2d 1012 (1972); Stiltner v. Rhay, 258 F. Supp. 487 (E.D. Wash. 1965).
This case should, therefore, be remanded to the trial court for the imposition of a legal sentence consistent with the governing statutes and the information to which the defendant entered a plea of guilty.
The defendant contends that since the judgment and sentence entered on May 3, 1973, was not stayed and the defendant has already been placed under the jurisdiction and supervision of the Department of Social and Health Services, such judgment and sentence constitutes a final judgment and sentence which cannot be altered by this court. We need not consider this contention because under the facts of this case we hold that the defendant did not commence serving his term of imprisonment under a valid judgment and sentence. In such an instance, this court has the power and the duty to correct the illegal sentence and to direct that the defendant be returned to the trial court for resentencing. Moreover, it is clear from the record that on June 28, 1973, this court did stay the determination of *194 the defendant's duration of confinement before the Board of Prison Terms and Paroles set the defendant's minimum term of imprisonment at 5 years.
The defendant further contends that remanding this case to the trial court for resentencing after he has already commenced serving his term of imprisonment would result in an increase in his sentence constituting double jeopardy. We find this contention to be without merit. We are not remanding this case to the trial court for the purpose of increasing a valid sentence, but rather we are sending the defendant back for the correction of an erroneous and invalid sentence. The Supreme Court of the United States addressed the issue of double jeopardy in Bozza v. United States, 330 U.S. 160, 166, 91 L.Ed. 818, 67 S.Ct. 645 (1947), where Mr. Justice Black stated:
It is well established that a sentence which does not comply with the letter of the criminal statute which authorizes it is so erroneous that it may be set aside on appeal, ... or in habeas corpus proceedings.... This Court has rejected the "doctrine that a prisoner, whose guilt is established, by a regular verdict, is to escape punishment altogether, because the court committed an error in passing the sentence." In re Bonner, supra at 260. [151 U.S. 242, 38 L.Ed. 149, 14 S.Ct. 323.] The Constitution does not require that sentencing should be a game in which a wrong move by the judge means immunity for the prisoner.... It did not twice put petitioner in jeopardy for the same offense. The sentence, as corrected, imposes a valid punishment for an offense instead of an invalid punishment for that offense.
(Footnotes and citations omitted.) Accord, United States ex rel. Ferrari v. Henderson, 474 F.2d 510 (2d Cir.1973); United States v. Thomas, 365 F. Supp. 173 (E.D.N.Y. 1972).
The instant case comes within the above rule. Moreover, the defendant cannot be prejudiced by the correction of the erroneous sentence entered on May 3, 1973, as he is entitled to be credited for any time he has already served in confinement under that sentence.
[5] The defendant further contends that a writ of mandamus *195 does not lie on these facts to compel a sentencing judge to enter the special finding of fact required by RCW 9.95.015. The record shows that the plaintiff was without an adequate remedy at law under CAROA 14 (8), and that the plaintiff moved timely for the writ on May 16, 1973, within the 15-day period required by CAROA 57 (e). Under our holding in this case where the sentencing judge has no discretion but to enter the special finding of fact required by statute, mandamus is the proper remedy to require the court to perform a mandatory act, as distinguished from a discretionary act. Nicholson v. Ballard, 7 Wn. App. 230, 499 P.2d 212 (1972). Therefore, this court is acting within its jurisdiction in granting the writ.
We hold that the writ of mandamus is granted. The case is remanded to the trial court for the resentencing of the defendant consistent with this opinion.
HALE, C.J., and FINLEY, ROSELLINI, HAMILTON, STAFFORD, WRIGHT, UTTER, and BRACHTENBACH, JJ., concur.
NOTES
[1]  As of July 1, 1973, RCW 10.46.090 was superseded by Criminal Rule for Superior Court 8.3, which provides:

"Rule 8.3 Dismissal.
"(a) On Motion of Prosecution. The court may, in its discretion, upon written motion of the prosecuting attorney setting forth the reason therefore, dismiss an indictment, information or complaint.
"(b) On Motion of Court. The court on its own motion in the furtherance of justice, after notice and hearing, may dismiss any criminal prosecution and shall set forth its reasons in a written order."
