ORDER
PER CURIAM.AND NOW, this 20th day of November, 2013, the order of the Commonwealth Court is VACATED, and this matter is REMANDED to the Commonwealth Court for transfer to the Philadelphia County Court of Common Pleas, in accord with the provisions contained within 42 Pa.C.S. § 5103(a) and Pa. R.C.P. 213(f).
In brief, Appellant filed a petition for review in the Commonwealth Court against the Department of Corrections (DOC), alleging that his confinement at the State Correctional Institution at Albion (SCI-Albion) was illegal due to an alleged failure of SCI-Albion to produce a written sentencing order related to the judgment of sentence entered against him on February 14, 2010, as allegedly required by 42 Pa.C.S. § 9764(a)(8). This *815section of the Sentencing Code provides in relevant part:
(a) General rule. — Upon commitment of an inmate to the custody of the Department of Corrections, the sheriff or transporting official shall provide to the institution’s records officer or duty officer, in addition to a copy of the court commitment form DC-300B generated from the Common Pleas Criminal Court Case Management System of the unified judicial system, the following information:
[[Image here]]
(8) A copy of the sentencing order and any detainers filed against the inmate which the county has notice.
When SCI-Albion failed to produce Appellant’s sentencing order, Appellant initially sought through the prison’s internal grievance process his outright release from SCI-Albion or, as an alternative, a return to Philadelphia County, and monetary damages. Upon his inmate grievances being denied, Appellant filed a petition for review in the Commonwealth Court, seeking the same. In a per curiam order, the Commonwealth Court sua sponte dismissed the petition for review for want of jurisdiction.
While we express no opinion regarding the merits of Appellant’s claims, he initially and principally is testing “the legality of [his] commitment and detention,” and therefore his petition for review sounded in habeas corpus. Commonwealth ex rel. Bryant v. Hendrick, 444 Pa. 83, 280 A.2d 110, 112 (1971); see also Warren v. DOC, 151 Pa.Cmwlth. 46, 616 A.2d 140, 142 (1992) (“An application for a writ of habeas corpus requests the applicant’s release from prison.”). To the extent the Commonwealth Court found that it did not possess jurisdiction over such a matter, it was correct. 42 Pa.C.S. § 761(a)(1)(i) (providing that the Commonwealth Court does not have original jurisdiction over matters sounding in habeas corpus unless ancillary to a pending appellate proceeding). Rather, matters sounding in habeas corpus lie in the jurisdiction and venue of the court of record from which the order of detention came. 42 Pa.C.S. § 6502.
However, pursuant to Section 5103(a) of the Judicial Code,
If an appeal or other matter is taken to or brought in a court or magisterial district of this Commonwealth which does not have jurisdiction of the appeal or other matter, the court or magisterial district judge shall not quash such appeal or dismiss the matter, but shall transfer the record thereof to the proper tribunal of this Commonwealth, where the appeal or other matter shall be treated as if originally filed in the transferee tribunal on the date when the appeal or other matter was first filed in a court or magisterial district of this Commonwealth.
42 Pa.C.S. § 5103(a). The prothonotary or clerk of the transferring court shall ensure the transfer of the record, and provide a certified copy of the docket entries filed in the transferring court, to the prothonotary or clerk of the accepting court. Pa. R.C.P. 213(f).
As noted above, Appellant’s petition for review sounded in habeas corpus, and therefore it is properly addressed in the court of record from which his judgment of sentence originated, specifically, the Philadelphia County Court of Common Pleas. 42 Pa.C.S. § 6502. Accordingly, given that a “proper tribunal of this Commonwealth” exists in which to consider Appellant’s claims, the Commonwealth Court should not have dismissed the petition for review, but rather transferred the matter to the Philadelphia County Court of Common Pleas. 42 Pa.C.S. § 5103(a). We therefore vacate the order of the Com*816monwealth Court dismissing Appellant’s petition, and remand this matter to the Commonwealth Court for transfer to the Philadelphia County Court of Common Pleas in accord with the mandates of 42 Pa.C.S. § 5103(a) and Pa. R.C.P. 213(f).
Chief Justice CASTILLE and Justice STEVENS would enter a per curiam affirmance.