
219 P.3d 1288 (2009)
2009-NMCA-112
STATE of New Mexico, Plaintiff-Appellee,
v.
Jose Javier LOPEZ, Defendant-Appellant.
No. 27,862.
Court of Appeals of New Mexico.
June 23, 2009.
Certiorari Denied, No. 31,839, September 2, 2009.
Gary K. King, Attorney General, Farhan Khan, Assistant Attorney General, Santa Fe, NM, for Appellee.
Hugh W. Dangler, Chief Public Defender, Corey J. Thompson, Assistant Appellate Defender, Santa Fe, NM, for Appellant.

OPINION
BUSTAMANTE, Judge.
{1} Defendant Jose Javier Lopez appeals the terms of his criminal commitment imposed pursuant to NMSA 1978, Section 31-9-1.5 (1999) of the New Mexico Mental Illness and Competency Code (NMMIC). Lopez argues *1289 that his pre-commitment confinement time should have been taken into account in determining the actual duration of his criminal commitment. The ultimate question is one of statutory interpretation. Specifically, whether in enacting Section 31-9-1.5 the Legislature intended for a criminally committed offender to face longer confinement than had he been actually convicted of the underlying crime. We conclude that the Legislature did not intend such an outcome and we reverse.

BACKGROUND
{2} In August 2004 Lopez allegedly attacked his mother with a knife, stabbing her in the throat area and on her wrists. This incident resulted in Lopez's indictment by a grand jury on the charges of attempted murder in the first degree, aggravated battery on a household member, and tampering with evidence. Proceedings on these charges were suspended pending a determination of Lopez's competence to stand trial pursuant to NMSA 1978, Section 31-9-1 (1993). In October 2005 the parties stipulated that Lopez was incompetent to stand trial and "dangerous," which resulted in his commitment to the New Mexico Behavioral Health Institute (NMBHI) for treatment to attain competency. Lopez was confined at NMBHI for a full year, after which time he remained incompetent to stand trial.
{3} In October 2006 the court scheduled an evidentiary hearing pursuant to Section 31-9-1.5. The parties stipulated that evidence supported a conviction of aggravated battery of a household member and tampering with evidence but not attempted murder. Based on these stipulations and pursuant to Section 31-9-1.5, the court committed Lopez to NMBHI for the maximum duration of three years for the third-degree felony offense of aggravated battery against a household member (great bodily harm).
{4} The parties agreed that pursuant to State v. Chorney, 2001-NMCA-050, ¶ 13, 130 N.M. 638, 29 P.3d 538, the tampering with evidence stipulation would not result in an enhancement of Lopez's commitment period. However, the parties disagree on the effect of NMSA 1978, Section 31-20-12 (1977), "[c]redit for time prior to conviction." Specifically, the parties dispute whether the approximately two years and two months that Lopez was confined at NMBHI prior to the Section 31-9-1.5 hearing should be credited against his three-year commitment. Lopez argues that the district court misapplied the statutes and ultimately violated his rights to equal protection and due process. We reverse on the statutory interpretation issue and do not reach Lopez's constitutional claims.

STANDARD OF REVIEW
{5} "Because we interpret the language of Section 31-9-1.5, our review is de novo." Chorney, 2001-NMCA-050, ¶ 4. In interpreting the NMMIC, our primary objective is to give effect to the Legislature's intent. State v. Trujillo, 2009-NMSC-012, ¶ 11, 146 N.M. 14, 206 P.3d 125. "[I]n determining intent we look to the language used and consider the statute's history and background." Key v. Chrysler Motors Corp., 121 N.M. 764, 768-69, 918 P.2d 350, 354-55 (1996).

DISCUSSION
{6} Section 31-9-1.5(D)(1) requires that, if a court determines by clear and convincing evidence that a "dangerous" defendant committed the crime charged, the defendant must be detained in a secure "locked facility." State v. Rotherham, 122 N.M. 246, 253, 923 P.2d 1131, 1138 (1996). Section 31-9-1.5(D)(2) requires that the period of detention not exceed the maximum sentence available had the defendant been convicted in a criminal proceeding. Id. In the event of a criminal conviction, "[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." Section 31-20-12.
{7} The district court declined to apply Section 31-20-12 to Lopez's term of confinement, concluding that it was inapplicable for several reasons. First, the court concluded that Section 31-20-12 applies only where *1290 there has been a criminal conviction, and that Lopez's criminal commitment was not a conviction. Further, the court concluded that it was otherwise inapplicable because commitment was not equivalent to a sentence in that it was not punishment. And finally, the court reasoned that commitment did not constitute a "sentence finally imposed" because Lopez could still be subject to a final sentencing, assuming that at some point he became competent to stand trial.
{8} We disagree with the approach taken by the district court and its result. The district court's approach was to analyze the language of Section 31-20-12 and then determine its applicability to Lopez. This approach cannot be reconciled with the language of Section 31-9-1.5 or the reasons for its enactment. When a question as to a defendant's competency is raised, all other proceedings outside of those prescribed by the NMMIC must be suspended until the issue of competency is resolved. Rotherham, 122 N.M. at 253, 923 P.2d at 1138. Thus, the district court's application of a criminal statute to Lopez outside the context and provisions of the NMMIC was improper. See Chorney, 2001-NMCA-050, ¶¶ 13-14 (holding that application of a habitual offender enhancement to extend the duration of commitment was improper because it did not relate to provisions of the NMMIC).
{9} Applying the plain language of the NMMIC, the maximum duration of a criminal commitment is determined by the following analysis. First, the district court must presume that there has been a conviction; second, based on this presumption, the court must determine the maximum sentence that could be imposed for such a conviction. See Rotherham, 122 N.M. at 253, 923 P.2d at 1138 (stating that commitment under Section 31-9-1.5(D)(2) cannot exceed the maximum sentence available had there been a conviction).
{10} Here, presuming Lopez was convicted, his pre-conviction confinement at NMBHI would have been credited against his post conviction sentence in accordance with Section 31-20-12. State v. La Badie, 87 N.M. 391, 392, 534 P.2d 483, 484 (Ct.App. 1975). Thus, to the extent that Lopez's pre-conviction confinement would have been credited against his sentence, so too must it be credited against the term of his criminal commitment. Any contrary conclusion would effectively treat Lopez more severely than if he had actually been convicted, which is inconsistent with the purpose of the NMMIC.
{11} In a comprehensive analysis of Section 31-9-1.5, our Supreme Court recognized that the NMMIC was adopted in the wake of the United States Supreme Court's decision in Jackson v. Indiana, 406 U.S. 715, 92 S.Ct. 1845, 32 L.Ed.2d 435 (1972); Rotherham, 122 N.M. at 252-53, 923 P.2d at 1137-38. In Jackson, the Court held that subjecting incompetent offenders to "a more lenient commitment standard and to a more stringent standard of release than those generally applicable" constituted a deprivation of equal protection. Rotherham, 122 N.M. at 256, 923 P.2d at 1141 (internal quotation marks and citation omitted). Section 31-9-1.5 imposes a more lenient commitment standard by lowering the burden of proof to clear and convincing evidence. To apply a more stringent standard argued for by the State would be to create the exact problem that the Legislature was trying to avoid. Thus, such an interpretation is contrary to the Legislature's intent.
{12} The State argues that the district court's approach was proper because the purpose of commitment is rehabilitative rather than punitive and, therefore, it is not analogous to a conviction as required by Section 31-20-12. We disagree because the argument relies on the flawed approach of applying Section 31-20-12 outside the context and requirements of Section 31-9-1.5(D)(2). Criminal commitment is based not only on the need for treatment, but also on an offender's past dangerous conduct. Rotherham, 122 N.M. at 258, 923 P.2d at 1143. Furthermore, while the State correctly points out that we have previously stated that "[c]ommitment pursuant to Section 31-9-1.5 is not punishment," we have also stated that it undeniably results in a loss of liberty. State v. Spriggs-Gore, 2003-NMCA-046, ¶¶ 21-22, 133 N.M. 479, 64 P.3d 506. The *1291 involuntary nature of commitment and the associated loss of liberty is the key aspect of commitment constituting "official confinement" equivalent to a sentence based on a conviction within the meaning of Section 31-20-12. La Badie, 87 N.M. at 392, 534 P.2d at 484.

CONCLUSION
{13} For the foregoing reasons, we reverse the district court's denial of pre-commitment credit and remand to the district court for proceedings consistent with this opinion.
{14} IT IS SO ORDERED.
WE CONCUR: CELIA FOY CASTILLO and ROBERT E. ROBLES, Judges.
