
571 P.2d 1091 (1977)
Nolan L. BROWN, District Attorney IN AND FOR the FIRST JUDICIAL DISTRICT, COUNTY OF JEFFERSON, State of Colorado, Petitioner,
v.
The DISTRICT COURT IN AND FOR the FIRST JUDICIAL DISTRICT, COUNTY OF JEFFERSON, State of Colorado, and the Honorable Anthony Vollack, one of the judges thereof, Respondents.
No. 27804.
Supreme Court of Colorado, En Banc.
November 7, 1977.
*1092 F. Joseph Mackey, III, Deputy Dist. Atty., Nolan L. Brown, Dist. Atty., Golden, for petitioner.
Rollie R. Rogers, Colo. State Public Defender, James F. Dumas, Jr., Chief Deputy State Public Defender, Denver, Peter Schild, Deputy State Public Defender, Golden, for respondent.
CARRIGAN, Justice.
The petitioner, district attorney for Jefferson County, brought this original proceeding pursuant to C.A.R. 21, seeking relief in the nature of mandamus. We issued a rule to show cause, and now make the rule absolute.
The defendant below was charged in Jefferson County District Court with second degree forgery, criminal impersonation, and misdemeanor theft. On October 30, 1975, the district court granted the defendant's motion to dismiss the first two charges, and the People appealed. On April 18, 1977, we reversed the district court's judgment and remanded the action for trial. People v. Brown, Colo., 562 P.2d 754 (1977).
By that time, the defendant had been incarcerated on other charges in the federal penitentiary in Leavenworth, Kansas. The Jefferson County district attorney learned, through communication with the El Paso County district attorney, that the El Paso County grand jury had indicted the defendant on a first-degree murder charge, and that El Paso County had instituted proceedings to bring the defendant from Kansas to Colorado through the Agreement on Detainers, an interstate compact. Section 24-60-501, et seq., C.R.S.1973. The El Paso County district attorney agreed to advise the Jefferson County district attorney when the defendant was brought back to Colorado, so that he could be prosecuted in Jefferson County.
The defendant arrived in Colorado on May 23, 1977, and appeared before the El Paso County District Court. On July 26, 1977, he was brought before the respondent Jefferson County District Court by a writ of habeas corpus ad prosequendum.
Before trial in Jefferson County, the respondent court ruled that the defendant was not properly before the court because the Jefferson County district attorney had not complied with the Agreement on Detainers Act, supra. The court therefore concluded that it had no jurisdiction over the defendant's person and ordered the trial date vacated. The People seek relief in the nature of mandamus ordering the district court to take jurisdiction.
The circumstances by which an accused person comes before a court have no bearing on the court's power to try him. Frisbie v. Collins, 342 U.S. 519, 72 S.Ct. 509, 96 L.Ed. 541 (1952). A court which has jurisdiction of the subject matter of the criminal prosecution need not inquire how a defendant was brought before it; his presence in court is sufficient to confer jurisdiction over his person. Massey v. People, 179 Colo. 167, 498 P.2d 953 (1972); DeBaca v. Trujillo, 167 Colo. 311, 447 P.2d 533 (1968).
Despite this general rule, the respondent asserts that, where an accused person is brought from imprisonment in another state for trial in Colorado, strict compliance with the Agreement on Detainers is an additional jurisdictional prerequisite. Although the detainer requirements were met by the El Paso County procedure, and the defendant consented to his return to Colorado for trial in El Paso County, he contended below that he would have contested his return had he known that he would also face trial in Jefferson County. The respondent court held that each county should have complied separately with the detainer requirements, and that the Jefferson County district attorney's failure to comply deprived the respondent court of jurisdiction to try the defendant. We do not agree.
The purpose of the Agreement on Detainers is "to encourage the expeditious and orderly disposition" of charges pending in one state against a person imprisoned in another. Section 24-60-501, Article I, C.R. S.1973. The agreement establishes co-operative procedures to meet that purpose. The obvious purpose of the agreement is to *1093 avoid the difficulties often encountered in interstate proceedings by providing an expeditious, simplified method of disposing of outstanding criminal charges. As such, the statute is generally designed to benefit the states, not the prisoners.
We do not imply that a prisoner is totally without protection under the detainer agreement. Cf. Moen v. Wilson, Colo., 536 P.2d 1129 (1975). However, we are not persuaded that the agreement is intended to stand as a barrier to a court's obtaining personal jurisdiction over criminal defendants, contrary to the general rule. Frisbie v. Collins, supra. See also, e. g., Lascelles v. Georgia, 148 U.S. 537, 13 S.Ct. 687, 37 L.Ed. 549 (1893); Goodspeed v. Beto, 341 F.2d 908 (5th Cir. 1965), cert. denied, 386 U.S. 926, 87 S.Ct. 867, 17 L.Ed.2d 798; Herman v. Brewer, Iowa, 193 N.W.2d 540 (1972); State v. Cochran, 79 N.M. 640, 447 P.2d 520 (1968). Cf. Gerstein v. Pugh, 420 U.S. 103, 95 S.Ct. 854, 43 L.Ed.2d 54 (1975). Such an interpretation would frustrate rather than promote the stated purposes of the detainer agreement.
Accordingly, the rule to show cause is made absolute and the cause is remanded to the district court for further proceedings consonant with this opinion.
GROVES, J., does not participate.
