
844 P.2d 847 (1992)
114 N.M. 597
STATE of New Mexico, Plaintiff-Appellee,
v.
Jerry IRVIN, Defendant-Appellant.
No. 13743.
Court of Appeals of New Mexico.
October 30, 1992.
*848 Tom Udall, Atty. Gen., Patricia Gandert, Asst. Atty. Gen., Santa Fe, for plaintiff-appellee.
Sue Anne Herrmann, Santa Fe, for defendant-appellant.

OPINION
ALARID, Chief Judge.
Defendant appeals from his conviction for possession of drug paraphernalia. Defendant's sole contention on appeal is that the trial court erred in denying him presentence confinement credit for a period when he was incarcerated on a parole violation due to the charges in this case. The first calendar notice proposed summary reversal. The second calendar notice proposed summary affirmance. The third calendar notice proposed summary reversal and remand for resentencing. The state received an extension of time to file a memorandum in opposition to the third calendar notice. However, the state filed a response to calendar notice, indicating that, although it believes that a remand is not necessary because the trial court imposed a valid sentence, it will not be filing a memorandum in opposition to this court's proposed summary reversal and remand. Defendant did not file a response to the third calendar notice, and the time for doing so has expired. For the reasons set out below, we reverse and remand for resentencing.

FACTS
On October 11, 1990, while on parole, defendant was arrested and charged with possession of a controlled substance (methadone) and drug paraphernalia. Defendant spent five days in jail before his release on bond for these charges. Defendant remained free on bond from October 16, 1990, until he was rearrested on December 21, 1990, for violating conditions of his parole. The October 1990 arrest on drug charges was the basis for the alleged violation of defendant's parole. Defendant's parole was revoked on December 21, 1990, and he was remanded to the state penitentiary. The record indicates that defendant was indicted by grand jury on the drug *849 charges on January 4 and that a bench warrant issued the same day. Defendant was released from the penitentiary on May 10 and he was rearrested the same day. The bench warrant was cancelled on May 13.
Defendant entered into a plea and disposition agreement, pursuant to which he pled guilty to possession of drug paraphernalia. The trial court sentenced defendant to 364 days in jail, to be served at the Bernalillo County Detention Center with no good-time credit and with work release authorized only if verified. Defendant moved for a determination of presentence confinement credit. Credit for the five days spent in jail in October 1990 after his initial arrest, and for the time period spent in jail after May 10, 1991, was not in dispute below, nor is it in dispute on appeal.
At the hearing held on defendant's motion, defendant argued that he should receive credit for the time between December 21, 1990, and May 10, 1991, which was the time served upon revocation of his parole. The trial court denied defendant's request for presentence confinement credit against his possession of drug paraphernalia conviction for this period of incarceration. Defendant appeals from this denial.

DISCUSSION
This court has consistently held that where confinement is related to the charges for which a defendant is ultimately sentenced, he is entitled to presentence confinement credit against such sentence, even where the confinement was not exclusively related to those charges. State v. Miranda, 108 N.M. 789, 779 P.2d 976 (Ct.App.1989); State v. Page, 100 N.M. 788, 676 P.2d 1353 (Ct.App.1984); State v. Ramzy, 98 N.M. 436, 649 P.2d 504 (Ct.App.1982); State v. Barefield, 92 N.M. 768, 595 P.2d 406 (Ct.App.1979). In these holdings, we have been construing NMSA 1978, Section 31-20-12 (Repl.Pamp. 1990), which provides that "[a] person held in official confinement on suspicion or charges of the commission of a felony shall, upon conviction of that or a lesser included offense, be given credit for the period spent in presentence confinement against any sentence finally imposed for that offense."
The state contends that defendant is not entitled to presentence confinement credit for the time during which he was incarcerated for violating the conditions of his parole. It argues that the presentence confinement period ended when defendant's parole was revoked because defendant then was confined pursuant to the prior conviction. The state relies on Stewart v. State, 112 N.M. 653, 818 P.2d 854 (1991), in support of this contention. Such reliance is misplaced.
The supreme court stated in Stewart that "[t]he presentence confinement period ends when parole is revoked, because petitioner then is confined pursuant to the prior conviction." 112 N.M. at 654, 818 P.2d at 855. We think the statement quoted from Stewart is limited to the facts of that case. Stewart was a pro se habeas corpus case in which the defendant sought to have the trial court specify the exact amount of presentence confinement with which he should have been credited. The supreme court's holding in Stewart is that the trial court is responsible for determining at the time of sentencing what the specific presentence confinement credit should be, based on relevant documents or other evidence. In Stewart the defendant was on parole when he committed several other crimes. The district court imposed sentences on the later crimes to be served consecutive to the time that remained on the defendant's initial sentence following revocation of his parole. On appeal, the supreme court held that presentence confinement ends when parole is revoked. We think this statement means that the presentence confinement in this case ended because additional sentences had been imposed to run consecutively to the initial sentence. See NMSA 1978, Section 31-18-21(B) (Repl.Pamp. 1990).
We do not think the court in Stewart intended to depart from the three-part test discussed in State v. Facteau, 109 N.M. 748, 790 P.2d 1029 (1990), and State v. Orona, 98 N.M. 668, 651 P.2d 1312 (Ct.App.1982), for determining if presentence *850 credit is appropriate. We think the facts of the present case are similar to the codefendant in Facteau. Applying the Facteau and Orona test to the case before us: (1) defendant was not confined at the time he was arrested on subsequent charges: (2) the second charges triggered defendant's incarceration; and (3) defendant was released on bond on the second charges, rearrested for violating the terms of his parole, and shortly thereafter a bench warrant issued on the second charges. Although defendant's sentence for possession of drug paraphernalia was not imposed until after he was released from the penitentiary on May 10, 1991, the bench warrant issued in connection with the second charges was not cancelled until May 13, and defendant was rearrested the day he was released from the penitentiary. On these facts, we think it was within the trial court's discretion to treat some or all of the time defendant was incarcerated prior to May 10 as a period of presentence confinement "related to the charge on which the [present] conviction is based." State v. Miranda, 108 N.M. at 792, 779 P.2d at 979.
The state also relies on Section 31-18-21 in support of its contention that defendant was properly denied presentence confinement credit in this case. The state contends that it is impossible to grant presentence confinement credit concurrent with credit for time served upon revocation of parole on the prior sentence and follow the mandate of Section 31-18-21(B). We disagree with this narrow interpretation of Section 31-18-21(B).
Section 31-18-21(B) provides that "[a]ny person, who commits a crime while [on parole,] and who is convicted and sentenced [for such crime,] shall serve the sentence consecutive to the remainder of the [parole] term [under which he was released], unless otherwise ordered by the court in sentencing for the new crime." (Emphasis added.) Subsection A provides, in part, that "[w]henever an inmate in a penal institution * * * is sentenced for committing any felony while he is an inmate, the sentence imposed shall be consecutive to the sentence being served."
The legislature made a distinction between crimes committed by persons while they are in a penal institution versus while they are outside of a penal institution on parole. We interpret Section 31-18-21(B) as providing the sentencing judge with discretion regarding whether to impose a sentence for a new crime consecutively or concurrently to the sentence for which the person is serving parole time. We interpret Section 31-18-21(A) as removing discretion from the sentencing judge, such that when a person commits a crime while serving time in a penal institution, the sentencing judge must impose the sentence on the new crime consecutive to the sentence that was being served when the crime was committed. Since defendant in this case was outside of a penal institution on parole when the drug paraphernalia offense was committed, the sentencing judge had discretion under Section 31-18-21(B) to make defendant's sentence run concurrent or consecutive to any sentence defendant was then serving for a parole violation. Thus, we see no barrier in Section 31-18-21(B) to a decision authorizing discretion in the trial court judge to award presentence confinement credit on the facts of this case.
The state also relies on State v. Facteau in support of its contention that defendant was properly denied presentence confinement credit. In Facteau, the defendant was serving time in the penitentiary on a burglary conviction when he escaped. When he was captured, he was immediately incarcerated to continue to serve time on his burglary conviction. He was later sentenced to an additional nine years for the escape, to run consecutively to his original burglary conviction. The trial court later granted the defendant's pro se motion for presentence confinement credit. The state appealed from such grant and our supreme court reversed, holding that the defendant was not entitled to presentence confinement credit.
The distinction made in Section 31-18-21 between crimes committed by persons while they are serving time in a penal institution versus while they are outside of a penal institution on parole was recognized *851 by the supreme court in Facteau. Facteau argued that he was entitled to presentence confinement credit because his codefendant was awarded such credit. However, Facteau's codefendant was out on parole and assisted in the escape. The supreme court noted that Facteau's codefendant was entitled to receive presentence confinement credit because he was not incarcerated at the time of the escape, but instead he was out on parole. The court noted that the codefendant's arrest and incarceration after committing the escape were directly related to the escape charges.
Defendant's situation in the present case is similar to that of Facteau's codefendant. We hold that, under Section 31-20-12 and Orona, the trial court had discretion to award defendant presentence confinement credit for that time spent in custody after his parole was revoked based on the drug paraphernalia charge for which he was ultimately sentenced in this case. We note that in Facteau Justice Baca restated and applied the three-part test set out in Orona to determine if presentence credit is appropriate. Facteau denied the claim for credit because there was "not a sufficient connection" between the circumstances underlying the incarceration for which credit was claimed and the sentence against which the defendant desired credit. 109 N.M. at 750, 790 P.2d at 1031. In this case, we think there are facts that would support a trial court's decision to award credit, and we remand to permit the court in this case to determine whether, in its discretion, additional credit is appropriate.

CONCLUSION
Accordingly, we reverse and remand for the purpose of allowing the trial court to consider a discretionary grant of presentence confinement credit in light of our clarification, as set out above, of recent cases construing Section 31-20-12 in light of Section 31-18-21.
IT IS SO ORDERED.
DONNELLY and MINZNER, JJ., concur.
