In this original proceeding in prohibition, the relator, John S. Sutton, seeks to prevent the Honorable Thomas H. Keadle, judge of the Circuit Court of Upshur County, and Alexander M. Ross, prosecuting attorney of Upshur County, the respondents, from trying him on a two-count felony indictment on the ground that the State failed to afford him a speedy trial as statutorily guaranteed by W.Va.Code, 62-3-21.
The essential facts in this case are not in dispute; only their legal significance is debated. The relator was indicted during the January 1984 term of the Circuit Court of Upshur County on felony charges of breaking and entering and grand larceny. The three regular annual terms of that circuit court commence on the second Monday in January, April, and September. W.Va. Code, 51-2-lz (1951).
At the time the indictment was returned, the relator was incarcerated in the Harrison County jail serving a sentence for an *140unrelated conviction. The relator was brought from the Harrison County jail in February, 1984, to appear before the Ups-hur County Circuit Court. The circumstances surrounding his release from jail are not shown by the record before us. At that appearance, the relator’s counsel and the assistant prosecuting attorney of Ups-hur County made a joint motion to continue the case until the next regular term of the circuit court. The joint motion was granted by order entered on February 29, 1984, and the case was continued to the April 1984 term of court. The relator was remanded to the custody of the Sheriff of Harrison County and was ordered to reappear before the circuit court for further proceedings on April 9, 1984, the beginning of the April 1984 term.
The relator was returned to the Harrison County jail where he remained until October of 1984, when he was released from custody upon completion of his jail sentence. He was not brought back before the circuit court at the beginning of the April 1984 term as had been provided for in the court's order, and the prosecution made no effort to secure his presence for trial during the period of his incarceration. After his release, the relator remained in Harrison County where he had formerly resided. No effort was made to prosecute the relator during the April 1984, September 1984, and January 1985 regular terms of court.
On May 20, 1985, the relator voluntarily appeared before the circuit court and presented a motion to dismiss the indictment and discharge him from prosecution on those charges, asserting that the State had failed to prosecute him within three regular terms of court after the term in which he was indicted and was therefore barred from prosecuting him under the express provisions of W.Va.Code, 62-3-21.
The circuit court judge, relying on the authority of State ex rel. Smith v. DeBerry, 146 W.Va. 534, 120 S.E.2d 504 (1961), found that the Harrison County Circuit Court had exclusive custody and control over the relator during his incarceration in the county jail and that the relator was effectively outside or without the jurisdiction of the Circuit Court of Upshur County from January, 1984, until the relator was released in October, 1984. Consequently, he held that there was no violation of the three-term statute. The trial court judge also found that the prosecuting attorney of Upshur County had filed a detainer with the sheriffs office in Harrison County, but that the relator was released without the Upshur County authorities being notified.
Some confusion in our law has been engendered by Ex Parte Hollandsworth v. Godby, 93 W.Va. 543, 117 S.E. 369 (1923), and Syllabus Point 2 of DeBerry, where we stated: “Where a defendant is incarcerated in a county jail on a charge contained in an indictment returned in that county, he is not, within the meaning of Code, 62-3-21, as amended, held for trial on a charge alleged to have been committed in another county.” The defendant in DeBerry had been arrested on a felonious assault charge in Tyler County in March, 1960, and had been held in jail. Subsequently, the victim died. In the July 1960 term, the defendant was indicted for murder. In the meantime, he was indicted on five felonies in the April 1960 term of the Pleasants County Circuit Court and these indictments were served on him while he was incarcerated in the Tyler County jail.
In March, 1961, the defendant entered a plea to voluntary manslaughter in Tyler County and was sentenced to the State penitentiary. He was later brought to the Circuit Court of Pleasants County in its April 1961 term for trial on the five felonies. The court concluded that he had not been held for trial in Pleasants County during the time he had been incarcerated in Tyler County and denied him relief.
However, in Hollandsworth the defendant was arrested in Mercer County on a felony warrant issued in Raleigh County. During the course of being arrested in Mercer County, the defendant injured one of the arresting officers and was charged with felonious assault and taken to the Mercer County jail. He remained in the Mercer County jail until he was sentenced to the State penitentiary on the felonious *141assault charge. After he was in the penitentiary for approximately one year, he was brought back for trial in Raleigh County. He claimed the benefit of the three-term rule which we found applicable and discharged him from further prosecution.
In Hollandsworth, we concluded that the beginning phrase in W.Va.Code, 62-3-21, “[e]very person charged ... and remanded to a court of competent jurisdiction” meant that if the defendant is held for trial by way of being arrested this would trigger the three-term rule. In DeBerry, we said that the defendant was in the exclusive custody of Tyler County and, therefore, was not held by Pleasants County. In this situation, we held, in effect, that the three-term statute had been tolled.
Without being unduly critical of either case, it would appear that the proper answer to the question of when the three-term rule begins to run where a defendant is under indictment in more than one county in this State cannot be resolved by trying to determine when a defendant is remanded1 or held for trial.
It is apparent from the language of the three-term statute2 that it begins to run at the term subsequent to the term that the indictment or presentment is returned to a court of competent jurisdiction.3 This is a fact that is independent of the defendant’s physical location. It is true that the statute tolls the three-term rule for certain specified reasons.4 However, these exemptions do not cover the situation we have in the present case where the defendant is being held in another county in this State.
We have often stated that the three-term rule statute is a legislative enactment which is designed to afford the defendant a speedy trial as mandated by Article III, Section 14 of the West Virginia Constitution and the Sixth Amendment to the United States Constitution. See State ex rel. Shorter v. Hey, 170 W.Va. 249, 294 S.E.2d 51 (1981); State v. Young, 167 W.Va. 312, 280 S.E.2d 104 (1981); State v. Underwood, 130 W.Va. 166, 43 S.E.2d 61 (1947).
We do not believe that where the State is diligently pursuing prosecution of the defendant in one county that the charges against the defendant in the other county are then subject to the three-term rule. To hold otherwise would result in a total confusion of orderly trial procedures and require the defendant to be shuttled back and forth between the two counties where the charges are pending. The situation would, of course, become even more exacerbated if more than two counties were involved or if there were multiple charges in one county that necessitated multiple trials.5
*142Oddly enough this matter has not received a great deal of attention by other courts. This may be in part due to the fact that in some states legislative enactments have taken care of the problem, as illustrated by Slaughter v. State, 683 S.W.2d 746 (Tex.Ct.App.1984). There the court concluded that the period the defendant was held for trial in one county was not to be counted on criminal proceedings pending in another county by virtue of Article 32A.02 of the Texas Code of Criminal Procedure (Vernon Supp.1984).6
The Illinois Supreme Court, after noting the lack of precedent in other states, settled the question in People v. Davis, 97 Ill.2d 1, 72 Ill.Dec. 272, 452 N.E.2d 525 (1983). It had a general speedy trial statute,7 and followed the rule developed by its intermediate appellate courts:
“However, the vast majority of appellate court decisions resolving the issue have stated that where a defendant ‘is in custody awaiting trial in one county and there is a charge pending against him in another county, * * * he cannot be deemed to be in custody for the latter offense until such time as the proceedings against him in the first county are terminated and he is then returned to, or held in custody for, the second county.’ ” 97 Ill.2d at 13, 72 Ill.Dec. at 277, 452 N.E.2d at 530. (Citations omitted).8
This result parallels to some extent the reasoning in DeBerry. However, we believe DeBerry is overly broad in regard to its Syllabus Points 2 and 3 to the extent that they fail to delineate between a situation where the defendant is being held for trial in a county and where he is actually serving a sentence in that county or in a state’s penal institutions.9 Where the defendant is incarcerated serving a sentence there is no disruption of any trial proceedings in the county where he is being held.10 Consequently, the reason for not counting *143the time during which the defendant is awaiting trial in one county on charges pending in another county is not applicable.
Furthermore, to create a complete bar to the operation of the three-term rule because of a defendant’s incarceration in another county would create an anomaly with Syllabus Point 2 of State ex rel. Stines v. Locke, 159 W.Va. 292, 220 S.E.2d 443 (1975). There we held it was incumbent on the State to procure the presence of a defendant who is incarcerated out of state when he has been charged with a crime in this State:
“Where one indicted for a felony in this state has been incarcerated in another state, the prosecuting authorities in this jurisdiction, pursuant to the provisions of W.Va.Code, 1931, 62-14-1, as amended, are under a mandatory duty to apply to the authorities of the incarcerating state for temporary custody of said accused for the purpose of offering him a speedy trial and the failure of the state to so act will cause the terms during which he was so imprisoned to be chargeable against the state under W. Va. Code, 1931, 62-3-21, as amended.”
In State ex rel. Boso v. Warmuth, 165 W.Va. 247, 270 S.E.2d 631 (1980), we held in Syllabus Point 2: “W.Va.Code 62-3-21 [1959], imposes a duty on the State to exercise reasonable diligence to procure temporary custody of the defendant who has fled the State for the purpose of offering him a speedy trial once the defendant’s out-of-state whereabouts become known.” It is clear from reading Boso that it relied on Stines as setting the duty to seek to bring an out-of-state defendant back to trial. The important facts in Stines were that the defendant was incarcerated in another state serving a sentence, his whereabouts were known, and he could have been temporarily returned to this State under our detainer compact with other states. W.Va. Code, 62-14-1.
By the terms of the detainer compact, a detainer is available to acquire custody of “a prisoner ... who is serving a term of imprisonment in any party state.” W.Va. Code, 62-14-1, Art. IV(a). Courts that have interpreted this section have consistently held that the defendant must be incarcerated under sentence out of state. State v. Reynolds, 218 Neb. 753, 359 N.W.2d 93 (1984), citing People v. Bentley, 121 Mich.App. 36, 328 N.W.2d 389 (1982); People v. Daily, 46 Ill.App.3d 195, 4 Ill.Dec. 756, 360 N.E.2d 1131 (1977), and United States v. Mauro, 436 U.S. 340, 98 S.Ct. 1834, 56 L.Ed.2d 329 (1978). Consequently, if a defendant is being held for trial in another state, this will not be sufficient under this section of the detainer compact. State v. Binn, 196 N.J.Super. 102, 481 A.2d 599 (1984).11 The reason is apparent: if a state could demand the temporary return of an out-of-state defendant who is being held for trial, this would frustrate the orderly trial process in the state where he is being held for trial.
In Boso, it is unclear whether the out-of-state defendant was being held for trial or was incarcerated. Unfortunately, Syllabus Point 2; which we have earlier quoted, uses the phrase “defendant who has fled the state.” As a generic description of his status, this language may be accurate; however, as it relates to the State’s duty to seek his return, it is not accurate. Under W.Va.Code, 62-14-1, Art. IV(a), and the principles set out in Syllabus Point 2 of Stines, the State’s obligation to secure the temporary custody of an out-of-state defendant for purposes of trial in this State lies only to a defendant who is serving a term of imprisonment. To the extent that Syllabus Point 2 of Boso implies that it applies to an out-of-state defendant being held for trial in another state, it is disapproved.
This result is not only dictated by the precise language of W.Va.Code, 62-14-1, Art. IV(a), but reflects the underlying poli*144cy that the duty to return an out-of-state defendant should not arise where he is being held for trial in the foreign state. The rationale for this policy is to preserve a right in the holding state to make an orderly completion of its trial procedures before it has to release him to a demanding state.
We believe that this same policy should apply to a defendant who has charges pending against him in more than one county in this State. As long as a defendant is being held for trial in one county in this State, he is not entitled to have the three-term rule, W.Va.Code, 62-3-21, run in the county where other criminal charges are pending in this State. If, however, a defendant is incarcerated under a sentence in one county and there are criminal charges pending in another county in this State, then the prosecutor in the county where the charges are pending must exercise reasonable diligence to secure the defendant’s return for trial, otherwise the three-term rule, W.Va.Code, 62-3-21, is applicable. To the extent that Syllabus Points 2 and 3 of DeBerry and the Syllabus of Hollandsworth vary from these principles, they are overruled.
In the present case, the prosecutor of Upshur County was aware that the defendant was incarcerated in Harrison County under a sentence and not merely being held for trial. This was known in the January 1984 term and became chargeable in the April 1984, September 1984, and January 1985 terms when the prosecutor did not secure the defendant’s temporary custody for trial. We reject any argument that the issuance of a detainer by the Upshur County authorities to the authorities in Harrison County was an act of reasonable diligence which should toll a portion of the three-term rule.12 We decline to carve this out as an additional exception. A detainer is not a document that is designed to compel the production of a prisoner for purposes of prosecuting him. This is accomplished by a writ of habeas corpus ad prosequen-dum, as we pointed out in State v. Fender, 165 W.Va. 440, 268 S.E.2d 120 (1980). In Moore v. Whyte, 164 W.Va. 718, 266 S.E.2d 137 (1980), we defined a detainer as a notification filed with an institution in which a prisoner is serving a sentence advising that he is wanted on charges in another jurisdiction.13 Accord, People v. Moody, 676 P.2d 691, 693 (Colo.1984); Dobson v. United States, 449 A.2d 1082, 1085 (D.C.App.1982), cert. denied, 464 U.S. 831, 104 S.Ct. 109, 78 L.Ed.2d 111 (1983); Gilbreath v. State, 651 P.2d 699, 700 (Okla.Crim.Ct.App.1982).
For the foregoing reasons, we conclude that the provisions of W.Va.Code, 62-3-21, bar further proceedings and, therefore, a writ of prohibition is issued barring further prosecution of the underlying criminal charges.
Writ Issued.
. In State v. Kellison, 56 W.Va. 690, 692, 47 S.E. 166, 167 (1904), we pointed out that the phrase "remanded to a court of competent jurisdiction" was no longer consonant with our criminal practice.
. The pertinent language of W.Va.Code, 62-3-21, is:
"Every person charged by ... indictment with a felony ..., and remanded to a court of competent jurisdiction for trial, shall be forever discharged from prosecution for the offense, if there be three regular terms of such court, after the ... indictment is found against him, without a trial, unless the failure to try him was caused by ... a continuance granted on the motion of the accused-”
. This is reflected by Syllabus Point 1 of State ex rel. Spadafore v. Fox, 155 W.Va. 674, 186 S.E.2d 833 (1972):
"Under the provisions of Code, 62-3-21, as amended, the three unexcused regular terms of court that must pass before an accused can be discharged from further prosecution are regular terms occurring subsequent to the ending of the term at which the indictment was returned. The term at which the indictment was returned can not be counted as one of the three terms.”
See also State ex rel. Whytsell v. Boles, 149 W.Va. 324, 141 S.E.2d 70 (1965); Syllabus Point 1, State ex rel. Smith v. DeBerry, supra.
. W.Va.Code, 62-3-21, provides, in pertinent part:
"[Ujnless the failure to try him was caused by his insanity; or by the witnesses for the State being enticed or kept away, or prevented from attending by sickness or inevitable accident; or by a continuance granted on the motion of the accused; or by reason of his escaping from jail, or failing to appear according to his recognizance, or of the inability of the jury to agree in their verdict....”
. We have recognized that the defendant has a constitutional right to be present at all critical stages of a trial, which can include "[pjretrial hearings involving substantial matters of law or the testimony of witnesses....” State v. Boyd, *142160 W.Va. 234, 246, 233 S.E.2d 710, 719 (1977). See generally State v. Rhodes, 166 W.Va. 402, 274 S.E.2d 920 (1981); State v. Eden, 163 W.Va. 370, 256 S.E.2d 868 (1979); State v. Martin, 120 W.Va. 229, 197 S.E. 727 (1938).
.The applicable provisions of Article 32A.02 cited by the Texas court are:
“Sec. 4: In computing the time by which the state must be ready for trial, the following periods shall be excluded:
(1) A reasonable period of delay resulting from other proceedings involving the defendant, including but not limited to proceedings for the determination of competence to stand trial, hearing on pretrial motions, appeals and trials on other charges;
******
(9) a period of delay resulting from detention of the defendant in another jurisdiction if the State is aware of the detention and exercises due diligence to obtain his presence for trial;
.Davis, 97 Ill.2d at 10, 72 Ill.Dec. at 276, 452 N.E.2d at 529, quoted this portion of its statute:
"Defendant first contends that he was deprived of his right to a speedy trial in violation of section 103-5(a) of the Code of Criminal Procedure of 1963 (IIl.Rev.Stat.1979, ch. 38, par. 103-5(a)). This section provides, in relevant part:
‘Every person in custody in this State for an alleged offense shall be tried by the court having jurisdiction within 120 days from the date he was taken into custody unless delay is occasioned by the defendant * * *.”’
. In Davis, 97 Ill.2d at 13, 72 Ill.Dec. at 278, 452 N.E.2d at 531, the court quoted with approval this statement from People v. Clark, 104 Ill. App.2d 12, 20, 244 N.E.2d 842, 846 (1968):
"Any other construction would embarrass and harass the effective administration of criminal justice and would tend to favor an accused who is in custody of one county for a crime, but has formal charges pending against him, for which hold or detainer orders have been placed in several counties. Such an absurd result could not have been intended by the legislature when section 103-5(a) was enacted.”
. Syllabus Points 2 and 3 of DeBerry state:
"2. Where a defendant is incarcerated in a county jail on a charge contained in an indictment returned in that county, he is not, within the meaning of Code, 62-3-21, as amended, held for trial on a charge alleged to have been committed in another county.
"3. A defendant under indictment is not entitled to count as one of the terms of court essential to his discharge from further prosecution, as provided by Code, 62-3-21, as amended, any term of the court which occurred in part during the time he was without the jurisdiction of the court.”
. An obvious limitation to this statement is where the defendant is incarcerated serving a sentence, but there are other charges in that county on which trial preparations are underway.
. In Binn, the defendant was incarcerated in a New York prison, but had other charges pending in New York as well as New Jersey. He sought to compel New Jersey to proceed to take temporary custody. When it did not, he moved that the charges be dismissed. The New Jersey court held that the pending trial in New York tolled the time periods under the detainer compact.
. The record does not disclose the date the detainer was issued.
. Moore dealt with our Agreement on Detain-ers, W.Va.Code, 62-14-1 through -7, which is an interstate compact. In addition to a detainer being filed, this act requires a request for temporary custody of the defendant who is incarcerated in another jurisdiction, W.Va.Code, 62-14-1, Article IV(a), and we held that a writ of habeas corpus ad prosequendum constituted a written request for temporary custody under the act.