Nahmias, Justice.On May 31, 2017, the trial court in this case ordered the sheriff to take Ricky Lee Carr into custody solely because Carr had been charged with committing violent crimes and found mentally incompetent to stand trial. The court directed that Carr be transferred to and held by the Georgia Department of Behavioral Health and Developmental Disabilities for evaluation within 90 days as to whether there is a substantial probability that he will attain competency in the foreseeable future. In this appeal, Carr contends that this detention by the State violates his constitutional right to due process.Carr’s due process challenge to the statute that required his detention – OCGA § 17-7-130 (c) – can be divided into two parts. He argues first that the duration of the confinement allowed by the statute – which, he asserts, could be indefinite – is unconstitutional. We agree that indefinite or even unreasonably extended detention under § 17-7-130 (c) would be unconstitutional, but we do not agree that the statute permits such extended detention. Instead, to avoid that constitutional concern, we construe § 17-7-130 (c) as limiting the detention it authorizes to the reasonable time needed to fulfill its purpose. And because Carr initiated this appeal shortly after he was ordered to be detained, he has not as of yet shown on the record that the duration of his confinement is unreasonable.Carr also argues that the mandatory nature of his confinement based on § 17-7-130 (c) is not reasonably related to the State’s legitimate and important purpose of accurately determining whether a defendant can be restored to competency to be tried. Carr says this is so because the statute requires that all defendants found incompetent after being accused of violent crimes, but not those accused of other crimes, be detained for evaluation regardless of the characteristics or circumstances of the particular defendant’s mental condition. We agree that such automatic detention without an individualized determination of whether the confinement reasonably advances the government’s purpose violates a defendant’s right to due process, and we therefore hold that this part of § 17-7-130 (c) cannot be applied constitutionally to Carr or similarly situated defendants who are not already being detained on another, lawful ground.For these reasons, which are explained in much greater detail below, we reverse the part of the trial court’s judgment holding that OCGA § 17-7-130 (c) is constitutional, vacate the part of the judgment ordering Carr to be detained for inpatient evaluation, and remand the case for further proceedings consistent with this opinion.1. BackgroundRicky Lee Carr was arrested on June 16, 2016; he was released on bond the same day. About five months later, on November 9, 2016, a Catoosa County grand jury returned an indictment charging Carr with rape, aggravated sexual battery, two counts of child molestation, and criminal attempt to commit a felony.[1] On November 29, the trial court signed a consent order for the evaluation of Carr’s competency to stand trial. Dr. Sam Perri from the Georgia Department of Behavioral Health and Developmental Disabilities (the “department”) evaluated Carr and then filed a report with the trial court on March 9, 2017. Dr. Perri concluded that Carr is not competent to stand trial. He explained that Carr is in the “mild/moderate range of intellectual functioning” and has been diagnosed with cerebral palsy. Dr. Perri further explained that although Carr seems to understand the charges presented against him, he does not appear to understand the possible consequences if he is found guilty, he does not understand courtroom procedure or the roles of court personnel, and he does not have the cognitive abilities to assist in his defense. Dr. Perri also reported:In view of Mr. Carr’s low intellectual functioning there is a strong probability that he would not be able to be restored to competency. Nevertheless, it is my opinion that there should be an attempt to restore Mr. Carr to competency. If the court adjudicates Mr. Carr as not competent it is recommended that his restoration occur in a community setting rather than in a psychiatric facility. If this occurs, I have a staff person that will coordinate a restoration to competency program for Mr. Carr. Mr. Carr’s mother also stated that she would assist in ensuring that Mr. Carr participates in a restoration program.On April 27, 2017, Carr filed a petition to seek the restoration of his competency in a community (outpatient) setting. The petition also raised constitutional challenges to OCGA § 17-7-130, the Georgia statute governing pleas of mental incompetence to stand trial, claiming that insofar as the statute requires him to be placed in custody for attempted competency restoration, it deprives him of due process and of equal protection of the laws in violation of the United States and Georgia Constitutions. The court then held two hearings on Carr’s competency. At the first hearing on April 28, the court admitted Dr. Perri’s report and found Carr incompetent to stand trial based on the report. The court then announced, “it appears to me that I have to transfer custody to the department.” In response, Carr’s counsel reiterated his constitutional challenges to OCGA § 17-7-130.[2]At the second hearing, on May 31, 2017, the trial court began by explaining that Carr had been found incompetent and was not contesting that finding, so the question to be decided was “what we do with the next stage with Mr. Carr.” Carr again raised his constitutional challenges to OCGA § 17-7-130, arguing that because he was out on bond, it would be a violation of his due process and equal protection rights to order him into custody merely because he has been found incompetent to stand trial. The State argued that the statute is constitutional and that Carr’s constitutional challenges were untimely because he had not raised them at the first opportunity or with sufficient clarity. Later that day, the trial court issued an order finding that Carr is incompetent to stand trial and holding summarily that his constitutional challenges were timely raised and that OCGA § 17-7-130 does not violate constitutional due process or equal protection. The order also directed the sheriff to take custody of Carr and deliver him to the department, which was directed to evaluate and diagnose within 90 days of the order whether there is a substantial probability that Carr can attain mental competency to stand trial in the foreseeable future.[3]On June 8, 2017, the trial court entered a certificate of immediate review of its order. Carr then filed an application for interlocutory appeal, which this Court granted on August 2.[4] Carr filed a notice of appeal on August 11, and after the case was docketed and briefed, the Court heard oral arguments on December 11.[5]2. The statuteUnder OCGA § 17-7-130 (b) (1),If an accused files a motion requesting a competency evaluation, the court may order the department to conduct an evaluation by a physician or licensed psychologist to determine the accused’s mental competency to stand trial and, if such physician or licensed psychologist determines the accused to be mentally incompetent to stand trial, to make recommendations as to restoring the accused to competency.The statutory provision in dispute here, § 17-7-130 (c), then says, in relevant part:If the court finds the accused is mentally incompetent to stand trial, the court may order a department physician or licensed psychologist to evaluate and diagnose the accused as to whether there is a substantial probability that the accused will attain mental competency to stand trial in the foreseeable future. The court shall retain jurisdiction over the accused and shall transfer the accused to the physical custody of the department. At its discretion, the court may allow the evaluation to be performed on the accused as an outpatient if the accused is charged with a nonviolent offense. Such evaluation shall be performed within 90 days after the department has received actual custody of an accused or, in the case of an outpatient, a court order requiring evaluation of an accused. . . . .OCGA § 17-7-130 (a) (7) defines “[n]onviolent offense” as “any offense other than a violent offense,” and § 17-7-130 (a) (11) (A) defines “[v]iolent offense” to include “(i) A serious violent felony; (ii) A sexual offense; (iii) Criminal attempt to commit a serious violent felony; [and] (iv) Criminal attempt to commit a sexual offense . . . .”[6]If the evaluation shows that the defendant is mentally competent to stand trial, “the department shall immediately report that determination” and return the defendant to the court, with the defendant remaining in the custody of the sheriff, the court’s detention facility, or the department’s secure facility. OCGA § 17-7-130 (c) (1). See also id. (d) (explaining that if the department “determines at any time” that the defendant is competent, he must be returned to the court, with custody maintained in the same way). If the evaluation shows that the defendant is mentally incompetent to stand trial but there is a substantial probability that the defendant will be restored to competency in the foreseeable future, he can continue to be held in the department’s custody for up to nine more months to receive treatment. See id. (c) (3). If the evaluation shows that the defendant is unlikely to regain competency in the foreseeable future, within 45 days the court must consider a nolle prosequi of the pending charges and release the defendant or seek his civil commitment and commit or release him based on the outcome of the civil commitment trial. See id. (c) (2), (e).[7]It is clear that the trial court in this case did what the statute mandates: because Carr is charged with violent offenses, once the court found him mentally incompetent to stand trial, the court had no statutory discretion to consider Dr. Perri’s recommendation of attempted restoration in an outpatient setting or any other evidence regarding Carr’s mental condition, but rather was required to transfer Carr to the physical custody of the department to be detained there for up to 90 days while he was evaluated. The question we will address is whether that statutorily mandated confinement at a government institution complies with the constitutional requirement of due process.[8]3. The Interests of Carr and the State“In our society liberty is the norm, and detention prior to trial or without trial is the carefully limited exception.” United States v. Salerno, 481 U.S. 739, 755 (107 SCt 2095, 95 LE2d 697) (1987). Indeed, “the most elemental of liberty interests [is] the interest in being free from physical detention by one’s own government.” Hamdi v. Rumsfeld, 542 U.S. 507, 529 (124 SCt 2633, 159 LE2d 578) (2004) (plurality). See also Foucha v. Louisiana, 504 U.S. 71, 80, (112 SCt 1780, 118 LE2d 437) (1992) (“‘It is clear that commitment [to a mental institution] for any purpose constitutes a significant deprivation of liberty that requires due process protection.’” (citation omitted)); id. at 90 (Kennedy, J., dissenting) (“As incarceration of persons is the most common and one of the most feared instruments of state oppression and state indifference, we ought to acknowledge at the outset that freedom from this restraint is essential to the basic definition of liberty in the Fifth and Fourteenth Amendments of the Constitution.”); Hood v. Carsten, 267 Ga. 579, 581 (481 SE2d 525) (1997) (explaining that “[b]ecause a bond revocation involves the deprivation of one’s liberty, . . . the trial court’s decision to revoke bond must comport with at least minimal state and federal due process requirements”).Before he was found incompetent to stand trial and ordered detained for further evaluation under OCGA § 17-7-130 (c), Carr retained this “strong liberty interest,” Salerno, 481 U.S. at 750, as he was a free man. He had been arrested almost a year earlier, but released on bond the same day. Although accused of crimes defined as “violent offenses” under § 17-7-130, Carr is, of course, presumed innocent until proven guilty, and his detention was not based on any judicial finding that he poses a danger to himself, to anyone else, or to the community in general. No evidence showing his dangerousness was presented at the § 17-7-130 hearings. To the contrary, the fact that he was granted bail meant that a judge had found that he “[p]oses no significant threat or danger to any person, to the community, or to any property in the community,” OCGA § 17-6-1 (e) (2), and nothing in the record suggests that Carr had done anything to justify changing that finding or had violated his bond in any way. A finding of mental incompetence to stand trial does not equate to a finding of dangerousness to self or others. See Jackson v. Indiana, 406 U.S. 715, 727-728 (92 SCt 1845, 32 LE2d 435) (1972).[9]Nevertheless, in some limited circumstances, pretrial detention is permissible as a regulation serving a legitimate and “sufficiently compelling” government interest. Salerno, 481 U.S. at 748-749. Detention may be “permissible regulation,” rather than “impermissible punishment,” if it is “rationally . . . connected” to a non-punitive purpose and it is not excessive in relation to that purpose. Id. at 747 (citations and quotation marks omitted). In an opinion addressing another state’s statute that required a defendant who was found mentally incompetent to stand trial to be committed to a mental institution until he was made competent, the United States Supreme Court explained the applicable due process test in this way: “At the least, due process requires that the nature and duration of commitment bear some reasonable relation to the purpose for which the individual is committed.” Jackson, 406 U.S. at 738 (emphasis added).The apparent non-punitive purpose of detention based on OCGA § 17-7130 (c) is to accurately evaluate whether the defendant’s competency can be restored so that he can be tried. See id. (“[A] department physician or licensed psychologist [will] evaluate and diagnose the accused as to whether there is a substantial probability that the accused will attain mental competency to stand trial in the foreseeable future.”). That is a legitimate and important government interest. See Warren v. State, 297 Ga. 810, 826 (778 SE2d 749) (2015) (explaining that “‘[t]he Government’s interest in bringing to trial an individual accused of a serious crime is important’” and includes both a “‘substantial interest in timely prosecution’” and “‘a concomitant, constitutionally essential interest in assuring that the defendant’s trial is a fair one’” (quoting Sell v. United States, 539 U.S. 166, 180 (123 SCt 2174, 156 LE2d 197) (2003)). Thus, for defendants like Carr, we must determine whether there is a reasonable relation between this government purpose and both the duration and the nature of the commitment depriving them of their liberty. See Jackson, 406 U.S. at 738. We will address those two aspects of the detention required by § 17-7-130 (c) in turn.4. Duration of the detentionWe start with the duration of the detention, recognizing that this is an issue only if the person can lawfully be detained in the first place.(a) In 1972, the United States Supreme Court held in Jackson that Indiana’s statute mandating pretrial detention of criminal defendants based solely on their mental incompetence to stand trial violated due process because it required that defendants be detained until they regained competency. See 406 U.S. at 731. This meant that defendants like Jackson, a deaf and mute man with the “mental level of a pre-school child” and little likelihood of ever attaining competency, would be detained indefinitely. See id. at 717, 725-726. While declining to enumerate the maximum length of time a defendant could ever be detained to evaluate competency, the Court held that, as a matter of constitutional due process, “a person charged by a State with a criminal offense who is committed solely on account of his incapacity to proceed to trial cannot be held more than the reasonable period of time necessary to determine whether there is a substantial probability that he will attain that capacity in the foreseeable future.” Id. at 738.[10]Like many states and the federal government, Georgia addressed Jackson’s holding by establishing an express statutory time limit for the evaluation of a defendant’s likelihood to attain competency: when a defendant is found incompetent to stand trial and taken into custody on that basis, the court “shall transfer [the defendant] to the physical custody of the department” and the evaluation of the defendant’s likelihood to regain competency “shall be performed within 90 days after the department has received actual custody of an accused.” OCGA § 17-7-130 (c). See also 18 USC § 4241 (d) (limiting the time that a federal defendant found incompetent can be hospitalized for treatment to “a reasonable period of time, not to exceed four months, as is necessary to determine whether there is a substantial probability that in the foreseeable future he will attain the capacity to permit the proceedings to go forward”); Grant H. Morris & J. Reid Meloy, Out of Mind? Out of Sight: The Uncivil Commitment of Permanently Incompetent Criminal Defendants, 27 U.C. Davis L. Rev. 1, 10 (1993) (explaining that in response to Jackson, 20 states, including Georgia, specified the length of the detention or evaluation period).[11]Carr does not contend that the 90-day maximum evaluation period in OCGA § 17-7-130 (c) is necessarily excessive to achieve the government’s purpose of accurately evaluating a defendant, and we conclude that it is not. Many states have similar time limits. See Morris & Meloy, supra, at 10 (“Of the twenty states that specify the length of the detention period, ninety days is the most frequent period specified, with the shortest period being thirty days and the longest being twelve months.” (footnotes omitted)). Indeed, the deadline in Georgia’s statute is a month shorter than the four-month maximum allowed by the federal statute, which has been upheld against due process challenges based on Jackson by several federal circuit courts. See, e.g., United States v. Dalasta, 856 F3d 549, 553-554 (8th Cir. 2017); United States v. Strong, 489 F3d 1055, 1062-1063 (9th Cir. 2007).Carr argues, however, that while the express time limit of 90 days for completion of the evaluation may be reasonable, the statutory scheme actually allows a defendant detained due to § 17-7-130 (c) to be confined much longer than that, because there are no explicit provisions governing how quickly he must be transferred to the department, how quickly after the evaluation is done the department must provide it to the court, how quickly he will be returned to the court, or how quickly the court will act on the evaluation. Carr is correct that the statute says the 90-day clock begins to tick only when a defendant is physically delivered to the department and stops as soon as the evaluation is complete; there are no express time limits on the steps that must happen before and after that evaluation if the defendant remains incompetent.[12] If the lack of explicit deadlines for each of these steps meant that a defendant could be detained indefinitely under § 17-7-130 (c), the statute would be unconstitutional under Jackson. But § 17-7-130 (c) is not facially unconstitutional, because unlike the Indiana statute in Jackson, the Georgia statute does not mandate indefinite detention (that is, detention until an unattainable condition is achieved); our statute simply does not include express time limits for each of the several steps required to compete the statutory process.(b) “[A] statute should not be deemed facially invalid unless it is not readily subject to a narrowing construction,” as “every reasonable construction must be resorted to, in order to save a statute from unconstitutionality.” Haley v. State, 289 Ga. 515, 522 (712 SE2d 838) (2011) (citations and quotation marks omitted). Although there are not explicit time limits on every step of the process used in determining an incompetent defendant’s ability to be restored to competency, the express 90-day deadline on the evaluation period itself indicates that the General Assembly meant for the overall period of a defendant’s detention under § 17-7-130 (c) to be limited to the reasonable time needed to serve the purpose of accurate evaluation. Thus, a reasonable time limit for each step should be implied to preserve the statute’s constitutionality.In doing so, we note that in Jackson, which was decided before the four- month time limit was codified in 18 USC § 4241 (d), the Court explained that lower courts interpreting federal statutes allowing pretrial detention of mentally incompetent defendants had “expressed substantial doubt that [those statutes] could survive constitutional scrutiny if interpreted to authorize indefinite commitment” on the ground of incompetency alone. 406 U.S. at 733. Thus, those courts imposed a “rule of reasonableness” on the statutes, meaning that “[w]ithout a finding of dangerousness, one committed thereunder can be held only for a ‘reasonable period of time’ necessary to determine whether there is a substantial chance of his attaining the capacity to stand trial in the foreseeable future.” Id. We take the same approach with OCGA § 17-7-130 (c).In determining what duration of confinement is reasonable in this context, the court should consider not only the total time of detention but also whether the amount of time spent at a particular challenged step is unreasonable. For example, a federal circuit court considered a lawsuit brought on behalf of mentally incompetent defendants in Oregon who had been held between one and five months awaiting transfer to the state mental hospital. See Oregon Advocacy Center v. Mink, 322 F3d 1101, 1106 (9th Cir. 2003).[13] Citing Jackson, the court explained that “[h]olding incapacitated criminal defendants in jail for weeks or months violates their due process rights because the nature and duration of their incarceration bear no reasonable relation to the evaluative and restorative purposes for which courts commit those individuals.” Mink, 322 F3d at 1122. The court therefore affirmed the district court’s ruling that these defendants had a due process right to “reasonably timely transport to a treatment facility.” Id. at 1119, 1122. See also Advocacy Center for Elderly & Disabled v. Louisiana Dept. of Health & Hosps., 731 FSupp2d 603, 621 (E.D. La. 2010) (relying on Jackson to hold that “the continued imprisonment of the Incompetent Detainees in parish jails . . . does not bear a reasonable relationship to either restoring the Detainees to competency or determining that they will never become competent.”).Like the Court in Jackson, see 406 U.S. at 737-738, we need not decide precisely how long a defendant may be detained solely pursuant to OCGA § 177-130 (c) before he is delivered to the department for his evaluation, or how much time may pass between the completion of the evaluation and the court’s completion of the statutorily prescribed next steps. However, to maintain the facial constitutionality of OCGA § 17-7-130 (c) in this regard, we construe the statute to require that each step it prescribes last only as long as reasonably necessary to serve the State’s legitimate purpose of accurately determining the likelihood of the defendant’s attaining competency, and that the total period of detention based on the statute is also reasonable in relation to that purpose. See Jackson, 406 U.S. at 738. Specific defendants can enforce this constitutional requirement by bringing as-applied challenges, either by challenging the trial court’s evaluation order if it is believed to specify an unreasonable duration of confinement or by filing a petition for habeas corpus under OCGA § 9-14-1 (a) if their detention pursuant to § 17-7-130 (c) order is alleged to have extended for an unreasonable time.As his case is presented here, Carr cannot prevail on such a challenge. He initiated this appeal only days after being ordered detained for evaluation under § 17-7-13 0 (c), so he cannot show from the record that the duration of his actual confinement is unreasonable (assuming he can be properly detained at all). As for the trial court’s order, it requires that the department evaluate Carr within 90 days of the date of the order, rather than 90 days of the time he arrives at the department (as § 17-7-130 (c) allows). Thus, if complied with, the order would prevent any time that might pass between the entry of the order and the sheriff’s delivery of Carr to the department from extending the 90-day period that we have said is facially reasonable. The order does not limit the time for completing the next steps after the evaluation, but neither does it specify an unreasonable time for these steps. This is not, however, the end of the due process analysis.5. Nature of the detentionNo matter how short the duration of the detention, if the nature of the confinement is not reasonably related to the government’s purpose of accurately evaluating the individual defendant’s potential to attain competency, the detention is unconstitutional. See Foucha, 504 U.S. at 79 (“Due process requires that the nature of commitment bear some reasonable relation to the purpose for which the individual is committed.” (citing Jackson, 406 U.S. at 738)). Carr challenges the automatic nature of the detention under § 17-7-130 (c) for all defendants who are charged with violent offenses, as he is. We conclude that this challenge has merit.[14](a) We start with the understanding that confinement at a department facility is not required for the accurate evaluation the State seeks to obtain. The statute itself tells us this. OCGA § 17-7-130 (c) provides outpatient evaluation as an option for defendants who have been accused of nonviolent offenses: “At its discretion, the court may allow the evaluation to be performed on the accused as an outpatient if the accused is charged with a nonviolent offense.”[15] This reflects a legislative judgment that inpatient evaluation is not always necessary to accurately determine whether competency can be restored. So is in-custody evaluation that much better than outpatient evaluation as to always justify the deprivation of a defendant’s liberty, even though it is not necessary to accomplish the government’s goal? Although the federal statute (like OCGA § 17-7-130) contains no legislative findings on this point, several federal courts upholding the constitutionality of 18 USC § 4241 (d), which mandates hospitalization to evaluate the likelihood of restoring the competency of every incompetent federal defendant (not only those charged with certain offenses as in Georgia), have postulated several potential benefits of in-custody evaluations. The reasoning of those decisions does not lead us to the conclusion that Georgia’s statute is constitutional.For example, the Ninth Circuit, following the lead of the First and Eighth Circuits, has explained that a determination of whether a defendant is likely to regain competence “requires a more ‘careful and accurate diagnosis’ than the ‘brief interviews’ and ‘review of medical records’ that tend to characterize the initial competency proceeding.” Strong, 489 F3d at 1062 (quoting United States v. Filippi, 211 F3d 649, 651 (1st Cir. 2000), and United States v. Ferro, 321 F3d 756, 762 (8th Cir. 2003)). That seems true enough, but neither the legislature nor these courts have explained why commitment is reasonable in every case to achieve this more “careful and accurate diagnosis.” A defendant who is evaluated by the department on an outpatient basis can certainly be subjected to more than a “brief interview,” and the department can easily collect more information from and about him than what is provided by a mere “review of medical records.”The Eighth Circuit has also suggested that the defendant’s commitment “appropriately affords additional time during which the Attorney General may explore medical options.” Ferro, 321 F3d at 762. True again, but under OCGA § 17-7-130 (c), the department has the same additional time – up to 90 days – to “explore medical options” for an outpatient defendant as for an inpatient one. See OCGA § 17-7-130 (c) (“Such evaluation shall be performed within 90 days after the department has received actual custody of an accused or, in the case of an outpatient, a court order requiring evaluation of an accused.”).[16] The same court has asserted that detention is authorized because determining the potential for improvement in a defendant’s mental condition “is an uncertain issue Congress committed initially to medical professionals.” Dalasta, 856 F3d at 553-554. See also State v. Coats, 3 NE3d 528, 534 (Ind. 2014) (“[T]he legislature entrusts only the superintendent of [the] state institution where the defendant has been committed with the power to determine that the defendant does not have a substantial probability of attaining competency to stand trial within the foreseeable future.”). Under the Georgia statutory scheme, however, commitment is not required to ensure that the evaluation is conducted by a medical professional trusted by the General Assembly. Whether the defendant is evaluated on an outpatient or inpatient basis, the evaluation must be done by “a department physician or licensed psychologist.” OCGA § 17-7-130 (c).The Dalasta court also said that commitment “provides the Attorney General’s medical experts an opportunity to evaluate the defendant’s dangerousness.” 856 F3d at 554. But an evaluation of dangerousness is not a purpose indicated anywhere in the federal or Georgia statute, and indeed Jackson distinguished between a finding of dangerousness and a finding of incompetence to stand trial. See 406 U.S. at 727-728.Finally, to the extent the State asserts that the constant surveillance and close control afforded by detention is important in all cases to ensure an accurate determination of the likelihood of competency restoration, see Coats, 3 NE3d at 534, our legislature evidently did not rest the current version of § 17-7-130 (c) on that theory, because the statute allows a large group of accused offenders – those charged with nonviolent crimes – to avoid these supervisory conditions. Moreover, the kind of crime the defendant allegedly committed bears no obvious relationship to the appropriate process for evaluating the probability that he will attain competency to stand trial in the foreseeable future. See Morris & Meloy, supra, at 18 (“A defendant charged with a serious crime is not by that fact more difficult to treat or less responsive to treatment than a defendant charged with a less serious crime.”).Rather than the particular crime with which a defendant is charged, it is his particular mental condition that affects whether his commitment is reasonably related to the goal of accurately evaluating his likelihood of attaining competence so he can be tried. Only in those cases where detention is in fact reasonably related to this objective does the State’s interest justify depriving the defendant of his strong liberty interest. See, e.g., Salerno, 481 U.S. at 750-751 (upholding the federal Bail Reform Act against a due process challenge, emphasizing that the statute allows for pretrial detention of defendants without bond only under “narrow circumstances,” which the government must demonstrate exist in the particular case in a way that convinces a neutral decision-maker); Jackson, 406 U.S. at 738 (noting with disapproval that there were no formal commitment proceedings addressing Jackson’s own ability to function in society, society’s interest in his restraint, or the State’s ability to help him attain competency through custodial care or compulsory treatment); Hood, 267 Ga. at 582-583 (holding that before a court revokes a defendant’s bond, due process requires “a meaningful opportunity to be heard,” including the presentation of evidence and findings by the court). Cf. Sell, 539 U.S. at 180181 (explaining that “[c]ourts . . . must consider the facts of the individual case in evaluating the Government’s interest in prosecution,” and that an indictee who is incompetent to stand trial may be involuntarily medicated only if the proposed medication “will significantly further [the] state interests” and “is necessary to further those interests” (emphasis in the original)). Neither the crime of which a defendant is accused – a crime of which he must constitutionally be presumed innocent – nor the finding of incompetency to stand trial is itself a sufficient ground to detain a citizen. See Jackson, 406 U.S. at 728 (explaining that “pending criminal charges are insufficient to establish [dangerousness]“); O’Connor v. Donaldson, 422 U.S. 563, 575 (95 SCt 2486, 45 LE2d 396) (1975) (“A finding of ‘mental illness’ alone cannot justify a State’s locking a person up against his will.”).In fact, in some cases the evidence presented at the competency hearing may indicate that confinement will not serve the government’s purpose of accurately evaluating the defendant’s likelihood to attain competency. For example, the facility in which the defendant would be confined may not have the means to effectively care for or communicate with the defendant. See, e.g., Jackson, 406 U.S. at 719 (noting that a deaf-school interpreter “testified that Indiana had no facilities that could help someone as badly off as Jackson to learn minimal communication skills”). Or the department doctor who initially evaluated the defendant’s competency to stand trial may be able to conclude with reasonable medical certainty that the defendant will not be able to attain competence. See, e.g., Dalasta, 856 F3d at 551 (noting that two doctors who evaluated the defendant told the court that his incompetence was caused by the removal of part of his brain and he therefore would never regain competency); Filippi, 211 F3d at 650 (noting that medical evidence at the competency hearing showed that the defendant suffered from irreversible vascular dementia and could not be restored to competency); Coats, 3 NE3d at 529-530 (noting that the defendant had been diagnosed with Alzheimer’s disease and the court concluded at an earlier hearing that he could not be restored to competency). In these cases, at least without a showing by the State and a finding by the court that the proposed examination and treatment of the defendant in a confined setting has a realistic possibility of altering the status quo, commitment serves no legitimate purpose at all, and so does not justify the deprivation of the defendant’s liberty.[17]We acknowledge, however, that in many cases the constant observation and increased control afforded by a defendant’s detention in a department facility may reasonably promote the government’s purpose of accurate evaluation. For example, in cases where the doctor or the court itself suspects that the defendant may be feigning or exaggerating symptoms to avoid trial, or where the defendant’s diagnosis is truly uncertain or holds the potential for improvement rather than stasis or deterioration, close and extended observation and control may be beneficial to the department’s doctors. But the existence of such cases does not justify automatic detention for all defendants in Georgia’s courts who are accused of a violent crime and found incompetent to stand trial.(b) Because the nature of automatic commitment for all those defendants does not bear a reasonable relation to the State’s purpose of accurately determining the restorability of individual defendants’ competence to stand trial, that aspect of OCGA § 17-7-130 (c) violates due process when applied to defendants who have been deprived of their liberty based solely on that statutory provision. In such cases, the trial court should proceed as it does in determining how to evaluate mentally incompetent defendants accused of nonviolent offenses. To ensure that the nature of commitment to the department is appropriate for the particular defendant, the court should consider all relevant evidence and make a finding as to whether the evaluation required by § 17-7130 (c) should be conducted on an inpatient or outpatient basis. A defendant who is not already lawfully detained should be committed to the department only if the court finds that such confinement is reasonably related to the purpose of accurately evaluating whether that particular defendant can attain competency. A hearing on this issue should be held at the same time or promptly after the court initially determines the defendant’s competency to be tried. To the extent the prosecutor or the defendant wishes to present or contest evidence that speaks to the detention determination, that should be permitted. If the court determines that inpatient evaluation is not appropriate for a mentally incompetent defendant charged with a violent offense and not already detained for another, lawful reason, then the portion of § 17-7-130 (c) requiring commitment of that defendant to the physical custody of the department cannot be applied as a matter of constitutional due process.[18]6. ConclusionFor these reasons, the part of the trial court’s judgment concluding that OCGA § 17-7-130 (c) is constitutional is reversed, and the part of the judgment ordering Carr to be delivered to the custody of the department for evaluation is vacated. As noted above in footnote 3, the trial court’s unchallenged finding that Carr is incompetent to stand trial is affirmed. On remand, the trial court should proceed in accordance with this opinion, including exercising discretion in deciding whether Carr should be committed to the department’s custody for evaluation or should be evaluated on an outpatient basis.[19]Judgment affirmed in part, reversed in part, and vacated in part, and case remanded with direction. All the Justices concur.