Melton, Chief Justice. We granted a petition for certiorari in this case to address whether a detainee who has not yet been indicted can seek to bar his prosecution through a plea in bar on the basis that the statute of limitation for prosecution has expired. We hold that a plea in bar is not proper until an indictment has been filed. Based on the foregoing, we affirm the decision of the Court of Appeals. 1. Factual Background The underlying facts of this case are largely undisputed. In June 1996, a woman was assaulted, sodomized, and raped, and her residence was burglarized. No suspect was identified until March 2009, when a DNA match identified appellant Dewey Davis as the alleged perpetrator. At that time, Davis was serving a twenty-year prison sentence for another crime. The police obtained arrest warrants for Davis for burglary, aggravated assault, aggravated sodomy, and rape. However, they did not serve the warrants until Davis was released from prison in 2016, seven years after the warrants were initially obtained. On June 23, 2016, Davis was arrested and transferred to the Muscogee County Jail. A magistrate judge held a preliminary hearing for the 1996 crimes, at which Davis’s counsel asserted that the charges were barred by the statute of limitation. The magistrate judge noted the argument, bound the case over to superior court to await indictment, and declined to set bond on any of the four charges.[1] After five months in confinement with no indictment, on November 28, 2016, Davis filed a motion for bond, pursuant to OCGA § 17-7-50, and a plea in bar asserting that the burglary and aggravated assault charges were barred from prosecution by the applicable statute of limitation. Although the trial court set bond on all four charges on December 19, 2016, Davis was unable to post bond and remained in confinement. In May of 2017, the trial court modified Davis’s bond to release him on his own recognizance subject to various restrictive conditions of release, but rescinded the order two days later.[2] Davis remained in confinement. Though still not indicted, Davis amended his plea in bar twice in 2017, extending his statute of limitation argument to the aggravated sodomy and rape charges. The trial court held several hearings on Davis’s plea in bar and, on September 21, 2017, the trial court granted the motion as to the burglary and aggravated assault charges, but denied it as to the aggravated sodomy and rape charges. Davis then appealed the trial court’s denial of his plea in bar for the charges of aggravated sodomy and rape to the Court of Appeals.[3] In Davis v. State, 347 Ga. App. 757 (820 SE2d 791) (2018), the Court of Appeals affirmed the trial court’s denial of Davis’s plea in bar. The court, however, did not address Davis’s statute of limitation argument. Instead, the court held that “there can be no challenge to an indictment through a special plea in bar until there is an indictment filed,” and that, because Davis alleged that he was being unlawfully detained, he should file a petition for a writ of habeas corpus. See id. at 758.[4] We granted Davis’s petition for certiorari to review the decision of the Court of Appeals. 2. Analysis Davis claims that the Court of Appeals erred in affirming the trial court, arguing that a plea in bar, and not a petition for habeas corpus, is the only appropriate method through which an individual can challenge pre-indictment detention as barred by the statute of limitation. The State contends that Davis should have raised the statute of limitation issue in his motion for bond, and that the Court of Appeals correctly determined that his pre-indictment plea in bar was premature.[5] We agree with the Court of Appeals that Davis must wait for the prosecutor to file an accusation or indictment before filing his plea in bar. Although not specifically defined by Georgia statute, pleas in bar originate from English common law.[6] A plea in bar is a challenge to the validity of an indictment. JOEL P. BISHOP, COMMENTARIES ON the Law of Criminal Procedure § 420 (1866) (collecting common law sources and explaining that “[through] a plea in bar the defendant shows, by matter extrinsic of the record, that the indictment is not maintainable”). A plea in bar can be “in confession and avoidance, that is admitting the facts charged but setting up new facts, either by way of discharge or in excuse, or justification, in avoidance of liability.” William H. Lloyd, Pleading, 71 U. PA. L. Rev. 26, 30 (1922) (describing the common law art of pleading) (emphasis in original). A plea in bar based on the statute of limitation is one in confession and avoidance, as its premise rests upon the assertion that, even if all the facts as alleged in the indictment are true, the defendant cannot be held liable due to the expiration of the statute of limitation. See, e.g., Jenkins v. State, 278 Ga. 598 (1) (A) (604 SE2d 789 (2004). As such, this sort of “special” plea in bar “seeks to defeat the . . . prosecutor’s action completely and permanently.” Black’s Law Dictionary (11th ed. 2019). Under Georgia law, a prosecution commences with the return of an indictment or the filing of an accusation. OCGA § 16-1-3 (14). This provision is consistent with the common law principles of pleading, which required a plaintiff to state his case in a pleading before a defendant responds with his own pleading.[7] See Lloyd, supra, at 30; Franklin F. Heard, The Principles of Criminal PLEADING 27-31, 262 (1879) (collecting and describing common law sources). It stands to reason that a prosecutor must initiate an action, through an indictment or formal accusation, before a person can file a pleading challenging such action. See OCGA § 17-7-110 (“All pretrial motions, including demurrers and special pleas, shall be filed within ten days after the date of arraignment, unless the time for filing is extended by the court.”); OCGA § 17-7-111 (“If the defendant, upon being arraigned, demurs to the indictment, pleads to the jurisdiction of the court, pleads in abatement, or enters any other special plea in bar, the demurrer or plea shall be made in writing.”). Thus, until either an indictment or an accusation is filed, a prosecutor’s action has not commenced and there is nothing for a plea in bar to defeat. Cf. Stynchcombe v. Hardy, 228 Ga. 130, 133 (2) (184 SE2d 356) (1971) (courts cannot issue writ of prohibition barring future prosecution prior to indictment). Therefore, we conclude that the Court of Appeals was correct in stating that Davis’s plea in bar was improper prior to indictment. Distinguishing between challenging one’s prosecution and one’s pre-indictment detention, the Court of Appeals also opined that Davis was not without a remedy, concluding that he could challenge his pre-indictment detention through a writ of habeas corpus. Davis, supra, 347 Ga. App. at 758. Although various mechanisms may exist to challenge one’s pre-indictment detention, including preliminary hearings, motions for bond and, in some cases, writs of habeas corpus, we express no opinion as to the propriety of these remedies in Davis’s case. Here, with regard to the only trial court order before us, Davis sought only to bar his prosecution in the trial court with a plea in bar, not to challenge his detention with a writ of habeas corpus. Therefore, the issue of whether habeas relief is available to address Davis’s detention was not before the Court of Appeals and is not before us. Judgment affirmed. All the Justices concur.