
    601 A.2d 1345
    Mr. James BROWN et al., Petitioners, v. DEPARTMENT OF CORRECTIONS, in their Official Capacity, and Mr. Jeffrey Beard, in his Official Capacity as Superintendent of Camp Hill, and Mr. Ernest D. Preate, Jr., in his Official Capacity as Attorney General of Pennsylvania, Respondents.
    Commonwealth Court of Pennsylvania.
    Submitted on Briefs Nov. 22, 1991.
    Decided Jan. 8, 1992.
    
      Robert Altland and Howard Hugar, Jr., for petitioners.
    Sandra W. Stoner, Deputy Atty. Gen., for respondent, Atty. Gen.
    
      David B. Famey, Acting Chief Counsel, for respondent, Dept, of Corrections and Jeffrey A. Beard.
    Before COLINS and KELLEY, JJ., and NARICK, Senior Judge.
   KELLEY, Judge.

James Brown, William Lucas, Robert Altland, Tony Hugar and Chris Jordan (prisoners) bring this suit in our original jurisdiction alleging that the Department of Corrections (DOC) lacked the authority to transfer the prisoners to a federal institution. The prisoners argue that because the transfer was in violation of both federal constitutional rights and state law, their sentences have been rendered void. Prisoners, therefore, request that they be immediately discharged from DOC’s custody.

DOC and the Attorney General (Commonwealth) have filed preliminary objections in which they argue that this court lacks subject matter jurisdiction. The Commonwealth also raises other preliminary objections. However, because we agree that jurisdiction does not lie in this court, we need not address the remaining preliminary objections of either party.

Our jurisdiction is prescribed by statute. Section 761 of the Judicial Code, 42 Pa.C.S. § 761 provides:

(a) General rule. — The Commonwealth Court shall have original jurisdiction of all civil actions or proceedings:
(1) Against the Commonwealth government, including any officer thereof, acting in his official capacity, except:
(i) actions or proceedings in the nature of applications for a writ of habeas corpus or postconviction relief not ancillary to proceedings within the appellate jurisdiction of the court;

The Commonwealth contends that the prisoners’ action is a habeas corpus proceeding because it seeks solely to challenge the legality of their confinement. We are constrained to agree.

In Municipal Publications v. Court of Common Pleas of Philadelphia County, 507 Pa. 194, 489 A.2d 1286 (1985), our Supreme Court considered the original jurisdiction of the Superior Court pursuant to Section 741 of the Judicial Code, 42 Pa.C.S. § 741, which provides that:

The Superior Court shall have no original jurisdiction, except in cases of mandamus and prohibition to courts of inferior jurisdiction where such relief is ancillary to matters within its appellate jurisdiction, and except that it, or any judge thereof, shall have full power and authority when and as often as there may be occasion, to issue writs of habeas corpus under like conditions returnable to the said court.

At issue in Municipal Publications was the question of whether a trial judge could preside over a hearing seeking his own recusal because of bias. Before the trial judge had finally ruled on the recusal motion, a writ of prohibition was filed in Superior Court, seeking to bar the trial judge from hearing the motion. Superior Court issued the writ and directed that another judge be appointed to hear the recusal motion.

Chief Justice Nix, writing for the court, held that the power of Superior Court to issue a writ of prohibition was a “purely incidental right” that was ancillary to proceedings pending in that court’s appellate jurisdiction. Id., 507 Pa. at 198, 489 A.2d at 1288 (quoting Bell Appeal, 396 Pa. 592, 152 A.2d 731 (1959)).

Similarly, we must conclude that our power to issue writs of habeas corpus must be narrowly confined to matters ancillary to proceedings in our appellate jurisdiction. Because no proceeding in our appellate jurisdiction is pending, this court lacks jurisdiction over the prisoners’ application for a writ of habeas corpus.

Neither can we treat this matter as properly lying within our original jurisdiction under Section 761(a) of the Judicial Code. In Wilson v. Bureau of Corrections, 85 Pa.Commonwealth Ct. 32, 480 A.2d 392 (1984), we held that the prisoners’ complaint, which alleged that the Commonwealth had improperly aggregated prisoners’ sentences, did not sound in habeas corpus and was, therefore, properly within our original jurisdiction. In so holding, however, we noted that:

The extraordinary relief of a writ of habeas corpus is available where the petitioner seeks to test the legality of his commitment and detention, or to secure relief from conditions constituting cruel and unusual punishment, even though the detention itself is legal.

Id., 85 Pa.Commonwealth Ct. at 34, 480 A.2d at 393 (quoting Commonwealth ex rel. Bryant v. Hendrick, 444 Pa. 83, 280 A.2d 110 (1971)).

The petitioner in Wilson was requesting only a correction of the records maintained by DOC and was in no way challenging the legality of the sentence or the conditions of confinement. It was within the province of this court to grant the relief requested, i.e., to order DOC to properly compute the sentences. In contrast, the prisoners here directly challenge the legality of their continued detention, grounded not merely on an administrative calculation, but on the theory that DOC has been deprived of the authority to continue prisoners’ incarceration. We can scarcely imagine a clearer example of a “proceeding in the nature of an application for a writ of habeas corpus,” as contemplated in Section 761(a) of the Judicial Code.

Accordingly, the Commonwealth’s preliminary objection raising lack of subject matter jurisdiction is sustained. Although we have determined that we lack jurisdiction to hear this case, Section 5103(a) of the Judicial Code, 42 Pa.C.S. § 5103(a) provides that this court shall not dismiss an erroneously filed matter for lack of jurisdiction, but shall transfer that case to the proper tribunal. See Szymanski v. Allegheny County Court Criminal Division, 77 Pa.Commonwealth Ct. 316, 465 A.2d 1081 (1983). Jurisdiction and venue lie in the court of common pleas wherein the order directing the prisoner’s detention or confinement was entered. 42 Pa.C.S. § 6502; Pa.R.Crim.P. 1701(a).

The record reveals that Lucas’ sentence was entered by the Court of Common Pleas of Lehigh County. As to the sentences of the remaining prisoners, we are unable to determine from the record in which judicial district venue would properly lie. Such information, however, is readily available to DOC. Accordingly, Lucas’ application for a writ of habeas corpus is transferred to the Court of Common Pleas of Lehigh County, and the remaining applications shall be transferred in accordance with our order.

ORDER

NOW, this 8th day of January, 1992, the preliminary objection of the Commonwealth raising lack of subject matter jurisdiction is sustained.

The application of William Lucas for a writ of habeas corpus is transferred to the Court of Common Pleas of Lehigh County, which shall address the Commonwealth's remaining preliminary objections and petitioner’s motion requesting leave to amend to include damages.

The Department of Corrections shall within fourteen (14) days from the date of this order file an affidavit attesting, for each remaining petitioner, the court of common pleas that imposed the sentence of judgment from which relief is currently being sought. Upon receipt of said affidavits, the Chief Clerk is directed to transfer the applications of the remaining petitioners to the appropriate courts of common pleas.

Petitioner’s brief, dated December 4, 1991, having been filed without leave of court after submission of the case to a panel of judges, is in violation of Pa.R.A.P. 2501(a) and is hereby stricken sua sponte. 
      
      . The dates and circumstances of prisoners’ transfers to federal custody and their subsequent return to state control are unclear; however, it is undisputed that the prisoners are now housed at the State Correctional Institution — Camp Hill.
     
      
      . Bell Appeal interpreted the predecessor of Section 741, the Act of June 24, 1895, P.L. 212, formerly, 17 P.S. § 181, repealed by Section 2 of the Act of April 28, 1978, P.L. 202, 42 P.S. § 20002(a)[806]. The former section, contrary to Section 741, explicitly granted to Superior Court original jurisdiction to issue writs of habeas corpus. Nevertheless, even under this broad grant of power, Superior Court consistently declined to issue writs of habeas corpus in cases which were not within that court’s exclusive appellate jurisdiction. See Common
        
        wealth ex rel. Burton v. Baldi, 147 Pa.Superior Ct. 193, 24 A.2d 76 (1942).
     
      
      . See also Gillespie v. Department of Corrections, 106 Pa.Commonwealth Ct. 500, 527 A.2d 1061 (1987).
     