OPINION
KLEINSCHMIDT, Judge.This case presents the question, among others, of whether the trial court has the power to vacate an order terminating probation that was entered by mistake. We hold that it does.
The issue arose in the following manner. The defendant, Tony Ramon Brooks, pled guilty to endangerment, a Class 6 open-end offense. Judge E.G. Noyes, Jr., of the Superior Court for Maricopa County, placed the defendant on probation fór a period of three years. Subsequently, on July 23, 1987, the defendant’s probation officer petitioned for an early termination of probation on the grounds that the defendant had successfully completed over half of the term imposed. This petition was presented to Judge Michael 0. Wilkinson, of the same court, who, on July 27, ordered that it would be granted unless the state filed a written objection within fifteen days.
On August 2, 1987, an incident occurred which led to the filing of a charge of attempted first-degree murder against the defendant. On August 6, 1987, the defendant’s probation officer filed a petition to revoke his probation based on the alleged attempted murder. On that same day, the county attorney, based on the- charge of attempted murder, filed a written objection to the early termination of probation. Instead of delivering a copy of this objection to Judge Wilkinson, a copy was sent to Judge Barry G. Silverman, another judge of the Superior Court for Maricopa County. On August 11, 1987, Judgé Wilkinson signed an order discharging the defendant from probation and designating the offense a misdemeanor. At the time he did this, Judge Wilkinson was unaware that the state had filed an objection to the request or that a petition to revoke was pending.
On September 16, 1987, despite the fact that probation had been terminated, a revocation arraignment was held béfore Judge Silverman. The defendant denied that he had violated his probation. On October 23, 1987, the state discovered that Judge Wilkinson had discharged the defendant from probation. It immediately filed a motion to vacate the order discharging the defendant from probation. Judge Wilkinson, observing that he had entered the order without knowledge of the state’s opposition and the petition to revoke, granted this motion to vacate the order. The matter ultimately proceeded to a hearing at which the defendant was found to be in violation of probation.
At about the same time the defendant was found to have violated probation, he pled guilty, pursuant to North Carolina v. Alford, 400 U.S. 25, 91 S.Ct. 160, 27 L.Ed.2d 162 (1970), to a charge of aggravated assault reduced from attempted murder. Sentencing on this charge and a disposition hearing on the probation violation were held at the same time. The defendant was sentenced to concurrent terms of 7.5 years’ imprisonment on the conviction for *179assault and 1.875 years for endangerment, the conviction for which he had originally been placed on probation. He appealed each conviction, and the matters have been consolidated for disposition.
On appeal, the defendant asserts that:
1. The trial court erred in granting the state’s motion to vacate the order terminating probation;
2. The trial court erred in denying the defendant the right to represent himself at the violation hearing;
3. The trial court erred in the amount of time it credited for presentence incarceration on the endangerment charge.
THE ORDER FOR TERMINATION OF PROBATION
The defendant, relying on A.R.S. § 13-901(0), which permits the court to revoke probation prior to the expiration or termination thereof, and on Keller v. Superior Court, 22 Ariz.App. 122, 524 P.2d 956 (1974), insists that once Judge Wilkinson signed the order terminating probation the court lost jurisdiction to do anything further in the case. The state, in response, posits three reasons why the trial court’s order setting aside the termination of probation was not error. It first argues that the discharge order was void ab initio because the judge who terminated the probation was not the same judge who had originally placed the defendant on probation. The argument is based on the fact that Rule 27.3, Arizona Rules of Criminal Procedure, 17 A.R.S., provides that “the sentencing court ... may terminate probation and discharge probation absolutely.” (Emphasis added.) “Sentencing court,” the state says, means “sentencing judge.” This argument fails.
The rule says “sentencing court,” not “sentencing judge.” The superior courts of the state constitute a single court. Ariz. Const, art. 6, § 13. If we gave the rule the effect for which the state argues, the violation hearing itself would have been invalid because it was not conducted by Judge Noyes, who originally sentenced the defendant, and Rule 27.9(b)(1) specifies that the “sentencing court” shall conduct such a hearing. Decisions from other jurisdictions support our conclusion. See Bartholomey v. State, 267 Md. 175, 187, 297 A.2d 696, 703 (1972); People v. Collins, 25 Mich.App. 609, 612, 181 N.W.2d 601, 602 (1970).
The state’s second argument is a response to the defendant’s reliance on Keller v. Superior Court, 22 Ariz.App. 122, 524 P.2d 956 (1974). In Keller, a petition to revoke was filed before the term of probation expired. Id. The violation hearing was held after the expiration of probation. Id. at 123, 524 P.2d at 957. The court of appeals ruled that once the term of probation expired, the trial court lost jurisdiction to revoke probation and sentence the defendant. Id. at 124, 524 P.2d at 958. This ruling was vitiated by the adoption of A.R.S. § 13-903(D) (Supp.1988), which provides that the filing of a petition to revoke tolls the running of the period of probation. The state argues that, since the order terminating probation was entered after the petition to revoke had been filed, the termination order had no legal effect. The problem with this argument is that the defendant’s probation did not expire as the result of the passage of time—which is all that A.R.S. § 13-903(D) addresses. Instead, probation was terminated by a direct order.
The state next argues that “it defies logic to believe that the judge that erroneously issued the order purporting to terminate probation lacks authority to vacate the order upon his discovery that the order was improperly entered.” We agree that the superior court has inherent authority to modify or vacate orders which it enters by mistake. This authority has been repeatedly recognized. In State v. Lopez, 96 Ariz. 169, 171, 393 P.2d 263, 265 (1964), the trial court denied the defendant’s motion for a new trial. Shortly thereafter, the supreme court issued a decision in a case which bore directly on the issue that underlay the motion for new trial. Id. at 171-72, 393 P.2d at 265. The defendant moved for a rehearing on the motion for new trial in light of that decision, and the trial court, stating that it lacked jurisdiction to grant rehearing, denied the motion. Id. The supreme court traced the evolution of the common *180law rule that a trial court has inherent power to vacate or modify its orders and judgments. Id. It concluded, based on Sam v. State, 33 Ariz. 421, 265 P. 622 (1928), that insofar as the rules of civil procedure codify the common law, they apply to criminal cases. Lopez, 96 Ariz. at 172, 393 P.2d at 265-66. The court looked to Rule 60(c) of the Rules of Civil Procedure and concluded that if any grounds existed under that rule, such as mistake or inadvertence, the court could vacate its order. Id.
State v. Johnson, 113 Ariz. 506, 557 P.2d 1063 (1976), is factually similar to the case before^ us. There, the defendant was charged with murder. The state, recognizing a jurisdictional defect in the complaint, moved to dismiss. The motion was granted without mention of whether the dismissal was with or without prejudice. Later the same day the grand jury issued an indictment. The defendant, before a different judge, then moved to dismiss the indictment because, he argued, the earlier dismissal had been with prejudice by operation of law. This motion was granted. Thereafter, the judge who had entered the first dismissal corrected his order to reflect that the dismissal of the complaint should have been without prejudice. Id. When the second judge learned that there was a question as to whether the first dismissal was with or without prejudice, he vacated his order dismissing the indictment. The supreme court, quoting from the earlier case of Belcher v. Superior Court, 105 Ariz. 461, 463, 466 P.2d 755, 757 (1970), said:
[T]he court does not lose jurisdiction in a matter by ordering its dismissal before jeopardy has attached, unless there is an abuse of discretion in vacating the order of dismissal and reinstating the case for trial.
Johnson, 113 Ariz. at 509, 557 P.2d at 1066.
Belcher relied in part on the reasoning of Lopez. See also Campbell v. Thurman, 96 Ariz. 212, 214, 393 P.2d 906, 908 (1964) (recognizing the rule announced in Lopez but holding that it does not apply if some other remedy for correcting a mistake or error exists). We also note that the holding in Lopez would not allow a court to resentence a defendant even if the sentence was based on a misapprehension of fact. See and compare State v. Carvajal, 147 Ariz. 307, 311, 709 P.2d 1366, 1370 (App. 1985) (where the defendant makes a fraudulent misrepresentation to the court, the sentence may be declared void) with State v. Suniga, 145 Ariz. 389, 395, 701 P.2d 1197, 1203 (App.1985) (rule that sentence may not be changed after lawful imposition is not altered by fact that trial court acted under a misapprehension not engendered by defendant).
Here, it could hardly be more clear that when Judge Wilkinson terminated the defendant’s probation he was acting under a mistake as to the status of the case. This is the type of relief codified in Rule 60(c), Arizona Rules of Civil Procedure, 16 A.R.S., which is within the court’s inherent power to provide. The judge acted within his authority in setting aside the order for termination.
SELF REPRESENTATION
The defendant contends that the trial court erred in denying his request to discharge his attorney and allow him, the defendant, to represent himself at the violation hearing. He relies, on Article 2, section 24 of the Arizona Constitution and on Faretta v. California, 422 U.S. 806, 95 S.Ct. 2525, 45 L.Ed.2d 562 (1975).
At the time the defendant made his request, the violation hearing was in progress. The state had submitted its case on the basis of the preliminary hearing on the charge which gave rise to the petition to revoke. The court had denied a petition to dismiss the petition for revocation. The only reason given for the defendant’s desire to represent himself was that witnesses he hoped had been subpoenaed were not present. An investigator who was familiar with what several of these witnesses had to say was present and ready to give evidence.
Once a proceeding begins, it is within the discretion of the trial court to grant or deny a defendant’s request to represent *181himself. See State v. De Nistor, 143 Ariz. 407, 694 P.2d 237 (1985). Here, the state had rested its case, and it was implicit that granting the request would entail a disruption of the proceedings. Denial of the request was not an abuse of discretion.
CREDIT FOR PRESENTENCE INCARCERATION
At the disposition hearing, the defendant was given credit for twelve days’ presentence incarceration on the endangerment charge. (Maricopa County Cause Number CR-151395.) This was for the twelve days he spent in custody before he was placed on probation. At the same time he was sentenced on the charge of aggravated assault to a concurrent term of 7.5 years with credit for 204 days’ presentence incarceration.
The record shows that the defendant was arrested on a bench warrant for his probation violation on September 9, 1987. He contends that he was entitled to credit for the 169 days that he spent in jail between September 9, 1987, and February 25, 1988, the date of the disposition hearing on the probation violation.
The state counters, arguing that since the defendant was already in custody on the charge of attempted murder (Maricopa County Cause Number CR-87-07442), he is not entitled to credit on both sentences. The state relies on State v. San Miguel, 132 Ariz. 57, 643 P.2d 1027 (App.1982). That reliance is misplaced. In San Miguel, the defendant was arrested on two warrants, one for probation violation and one for the commission of a new crime, trafficking in stolen property. One day after he was arrested he was released on his own recognizance on the trafficking charge but remained in custody on the probation violation. When he was ultimately sentenced on both, he claimed that all the time he spent in jail on the probation violation warrant should have been credited to the sentence for trafficking in stolen property. The court disagreed, noting that the right to such credit exists only when the time spent in confinement arises out of the offense for which the credit is claimed. Here, the defendant remained in custody on both warrants. He is entitled to credit for the time held on each warrant as to each concurrent sentence. See State v. De Passquallo, 140 Ariz. 228, 229, 681 P.2d 380, 381 (1984), and State v. Cruz-Mata, 138 Ariz. 370, 375-76, 674 P.2d 1368, 1373-74 (1983); A.R.S. § 13-709(B).
It is ordered affirming the judgments of conviction and sentences imposed. It is further ordered, pursuant to A.R.S. § 13-4037, granting the defendant credit for a total of 181 days presentence incarceration on the sentence for endangerment entered in Maricopa County Cause Number CR-151395.
BROOKS, P.J., and CONTRERAS, J., concur.