
365 F.Supp. 841 (1973)
James Lowell ROSE, Petitioner,
v.
UNITED STATES of America and the State of Illinois, Respondents.
No. 73 C 2047.
United States District Court, N. D. Illinois, E. D.
November 2, 1973.
*842 James Lowell Rose, pro se.
James R. Thompson, U. S. Atty., Thomas R. Mulroy, Jr., Asst. U. S. Atty., Chicago, Ill., for respondents.

MEMORANDUM OPINION AND ORDER
BAUER, District Judge.
This cause comes on James Lowell Rose's petition for habeas corpus.
Petitioner is currently confined in federal prison at Leavenworth, Kansas. He has filed his petition for habeas corpus seeking to have his state conviction set aside and to be granted a new trial from the State of Illinois. The petitioner argues that it was error for the federal government to have released him to the custody of the State of Illinois to be tried on state charges of forgery and theft. Further, petitioner maintains that the State of Illinois knew he was mentally ill but tried him for those crimes.
In September, 1968, petitioner was indicted by a Lake County, Illinois grand jury for the crimes of forgery and theft under Illinois law. Following his indictment, he was found incompetent to stand trial in a hearing which took place in the Circuit Court of Lake County. Petitioner was then committed to the Illinois Department of Public Health.
In August, 1969, petitioner was released from the Department of Public Health and was returned to Lake County. He was released on bond to the federal marshal in Chicago and was arraigned on a federal warrant from Nevada and released on a $5,000 surety bond.
On September 1, 1969, petitioner was arrested in Chicago for deceptive practices. Again he was released on bond. Four days later he was arrested in St. Louis, Missouri for committing the federal crime of armed robbery of a postal employee. Following a trial in the United States District Court for the Eastern District of Missouri, petitioner was found guilty and sentenced to one to ten years imprisonment.
On December 21, 1969, he was received in the federal criminal institution at Lompoc, California pursuant to the Missouri District Court sentence.
While awaiting trial in the federal court in California, petitioner filed a motion in the Lake County Circuit Court alleging that he had been denied a speedy trial in Lake County and that his case should be dismissed. On January 11, 1971, petitioner's motion was denied and the State of Illinois was ordered to secure the petitioner's presence by a writ returnable on March 2, 1971. Meanwhile, on August 20, 1970, petitioner had been transferred to the federal medical at Springfield, Missouri. Since the petitioner's motion for dismissal of the Lake County charges had been denied, on February 22, 1971 he was returned to Lake County for trial.
The petitioner moved for pre-trial sanity hearing on March 3, 1971 in relation to the Lake County trial proceedings. The jury was impanelled and the petitioner was found competent to stand trial. On March 29, 1971 petitioner was tried by a jury which found him guilty of the crimes charged in the indictment: forgery and theft in Lake County. Petitioner was represented by counsel in the Lake County proceedings.
Thus, petitioner had been incarcerated almost continually in federal institutions in Missouri, Nevada, Kansas and California from the time he was released on bond in 1969 from Lake County. At the time he filed his petition to dismiss his case in Lake County, because he had failed to appear in court, his bond had been forfeited and a capias issued for his arrest. He was finally returned to Lake County on February 22, 1971 pursuant to a writ of habeas corpus ad prosequendum.[*]
Petitioner appealed his conviction to the Illinois Appellate Court which affirmed in part and reversed in part, People v. Rose, 7 Ill.App.3d 374, 287 N. *843 E.2d 195 (1972). Petitioner claims in his petition that the Supreme Court of Illinois denied him the right to appeal. On May 8, 1973 petitioner filed for relief under the Illinois Post Conviction Act. That relief was denied by the sentencing court in Lake County.
This petition arises from the original Lake County indictment. The petitioner claims that the federal government was in error when they released him to state custody so that he could be tried under the Lake County grand jury indictment. However, this argument has no substance because petitioner had been indicted by a Lake County grand jury and was subsequently released on bond. The federal government merely returned petitioner to the Lake County authorities from whence he came.
Since petitioner is currently incarcerated in Kansas, this Court, technically speaking, has no jurisdiction with which to entertain this petition for habeas corpus because the petitioner was not within the jurisdiction of this Court when the petition was filed.
Section 2241(a) of 28 U.S.C., giving District Courts power to grant writs of habeas corpus "within their respective jurisdictions" has been interpreted by the Supreme Court as requiring the conclusion that a Federal District Court has no jurisdiction to issue the writ if the person detained is not within the territorial jurisdiction of the Court when the petition is filed. Ahrens v. Clark, 335 U.S. 188, 68 S.Ct. 1443, 92 L.Ed. 1898 (1948). See also Whiting v. Chew, 273 F.2d 885 (4th Cir. 1960), cert. denied, 362 U.S. 956, 80 S.Ct. 872, 4 L.Ed.2d 873.
The petitioner is apparently arguing that the Lake County Circuit Court had no jurisdiction over him and his conviction in the state court was thus invalid. Since the petitioner is attacking a sentence imposed by the State of Illinois the petition is apparently presented pursuant to 28 U.S.C. § 2254. Before a petition for habeas corpus will be entertained by this Court, the petitioner must allege errors which reach constitutional dimensions. Giamo v. Purdy, 346 F.Supp. 1 (S.D.Fla.1972). Petitioner has alleged no constitutional errors. He does not claim that his trial was unfair or that he did not receive a fair hearing on his mental competency. Petitioner merely contends that his return to Lake County court was a denial of equal protection of the laws. Throughout his petition, petitioner fails to mention the fact that while he was being tried in federal court, and while he was being held in a federal mental institution, he was at the same time out on bail from the Lake County Circuit Court.
The return of the petitioner to the Lake County Circuit Court through a writ of habeas corpus ad prosequendum was perfectly proper. A writ of habeas corpus ad prosequendum is the correct way to bring a prisoner under incarceration by state or federal courts to trial for alleged violations of laws. Morgan v. United States, 380 F.2d 686 (9th Cir. 1967), cert. denied, 390 U.S. 962, 88 S.Ct. 1064, 19 L.Ed.2d 1160; In re Van Collins, 160 F.Supp. 165 (D.C. Maine 1958).
A defendant who is charged with a criminal offense in the federal court and is at large on bail pending the determination of his case, if arrested and held in custody by the state authorities to answer a state indictment, outside the jurisdiction of the federal courts in which his case is pending, is not held in violation of his constitutional rights. Thus, he is not entitled to a discharge by a federal court on a writ of habeas corpus. Ex parte Marrin, 164 F. 631 (2nd Cir. 1908). The reverse is the case at bar. Here, the defendant was out on bail for a state charge and was taken into custody by the federal authorities and then returned to the state for trial on state charges.
A writ of habeas corpus ad prosequendum is a necessary tool for jurisdictional potency. Lawrence v. Willingham, 373 F.2d 731 (10th Cir. 1967). *844 A prisoner has no standing to contest his removal from one state to be arraigned in another if that is provided for in a writ of habeas corpus ad prosequendum. Derengowski v. United States Marshal, Minneapolis Office, Minnesota Division, 377 F.2d 223 (8th Cir. 1967), cert. denied, 389 U.S. 884, 88 S.Ct. 144, 19 L.Ed.2d 180. It is the very function of a writ of habeas corpus ad prosequendum to remove a prisoner to the proper jurisdiction for prosecution. Gilmore v. United States, 129 F.2d 199 (10th Cir. 1942), cert. denied, 317 U.S. 631, 63 S. Ct. 55, 87 L.Ed 509. Thus, the removal of the petitioner from a federal institution to the state court via a writ of habeas corpus ad prosequendum is not a violation of the petitioner's constitutional right.
The petitioner also contends that the State of Illinois erred when they tried him "well knowing that he was mentally ill". The petitioner states in his petition that on or about August 1, 1970 he was found mentally incompetent by a district court in the Northern District of California. He was returned to Lake County for trial on February 22, 1971.
It was on petitioner's own motion that a competency hearing was held in Lake County on March 3, 1971. Petitioner, again, alleges no constitutional deprivation in his argument. He does not contend that he was deprived of a full and fair hearing on his claim of mental incompetency. He was adequately represented by counsel at that hearing and the hearing was held before a jury. The petitioner makes no allegations of insufficient representation by his counsel. The state court of Illinois decided defendant's competency to stand trial under the laws of the State of Illinois (Illinois Revised Statutes, Ch. 38, § 104-1 et seq.). The hearing held to determine petitioner's competency fully resolved any question of petitioner's mental competency to stand trial. Habeas corpus is not a substitute for appeal. Judd v. Craven, 331 F.Supp. 391 (9th Cir. 1971). Federal habeas corpus is not intended to make federal courts an appellate court for reviewing a state criminal procedure. Wilson v. Rowe, 454 F.2d 585 (7th Cir. 1971), cert. denied, 406 U.S. 909, 92 S.Ct. 1618, 31 L. Ed.2d 820. The petitioner has failed to state any violation of his constitutional rights which is necessary for a writ of habeas corpus to be issued.
Accordingly, it is hereby ordered that the petitioner's writ of habeas corpus is denied.
NOTES
[*]   The above facts are taken from People v. Rose, 7 Ill.App.3d 374, 287 N.E.2d 195 (1972).
