
869 A.2d 1049 (2005)
Donald FORDYCE, Appellant
v.
CLERK OF COURTS, Forest County.
Commonwealth Court of Pennsylvania.
Submitted on Briefs November 12, 2004.
Decided February 7, 2005.
Reargument Denied April 7, 2005.
*1050 Donald G. Fordyce, pro se, for himself.
Joseph E. Altomare, Titusville, for appellee.
BEFORE: COLINS, President Judge, and SMITH-RIBNER, Judge, and JIULIANTE, Senior Judge.
OPINION BY Judge SMITH-RIBNER.
Donald Fordyce, an inmate at the State Correctional Institution at Waynesburg, appeals pro se from an order of the Court of Common Pleas of the Thirty-Seventh Judicial District, Forest County Branch, that sustained preliminary objections of the Clerk of Courts, Forest County (Clerk) in the nature of a demurrer to Fordyce's petition for writ of mandamus. Fordyce requests the Court to determine whether the sheriff's costs for transporting Fordyce from the county prison to the district justice's office and the courthouse during Fordyce's criminal proceedings and from the county prison to the State Correctional Institution after sentencing constitute "costs of prosecution" and whether Fordyce is required to reimburse the County for such expenses.
Fordyce was convicted of indecent assault and corruption of minors on February 1, 2002, and he was sentenced to serve combined terms of incarceration totaling 18 months to 6 years at the State Correctional Institution and ordered to pay the costs of prosecution. The Clerk subsequently assessed costs against Fordyce, including $300.26 incurred by the sheriff to transport Fordyce from the Warren County prison to the district justice's office on July 24, 2001, from the Warren County prison to the Forest County courthouse on February 1, 2002 for sentencing and from the Warren County prison to the State Correctional Institution on February 8, 2002.
Fordyce initially filed the petition for writ of mandamus with this Court seeking an order directing the Clerk to strike the sheriff's transportation costs of $300.26. By order dated October 28, 2002, this Court transferred the case to the trial court, which had exclusive jurisdiction over the matter. The Clerk thereafter filed preliminary objections in the nature of a demurrer, alleging that Fordyce failed to state a valid cause of action for the relief sought in his petition. Concluding that the sheriff's transportation costs are recoverable from Fordyce, the trial court sustained the Clerk's demurrer to Fordyce's petition.[1] He appealed to the Superior Court, *1051 which transferred the appeal to this Court. Before this Court, Fordyce contends that the sheriff's transportation costs do not constitute "the costs of prosecution" imposed by the sentencing court and that the County is required to bear the sheriff's costs under various statutory provisions.
A writ of mandamus is an extraordinary remedy, which compels the official performance of a ministerial act or a mandatory duty. Pennsylvania Dental Ass'n v. Insurance Department, 512 Pa. 217, 516 A.2d 647 (1986). A writ of mandamus may be issued only when there is a clear legal right in the plaintiff, a corresponding duty in the defendant and a lack of any other appropriate and adequate remedy. Delaware River Port Authority v. Thornburgh, 508 Pa. 11, 493 A.2d 1351 (1985). When reviewing an order sustaining a demurrer, the court must accept as true all well-pleaded facts and inferences reasonably deducible therefrom. Moore v. Board of Directors of City Trusts, 809 A.2d 420 (Pa.Cmwlth.2001). An order may be affirmed only when it is clear and free from doubt that the law will permit no relief under the facts. McGill v. Pennsylvania Department of Health, Office of Drug & Alcohol Programs, 758 A.2d 268 (Pa.Cmwlth.2000).
In sustaining the preliminary objections, the trial court relied upon Section 9728(g) of the Sentencing Code, as amended, 42 Pa.C.S. § 9728(g). Section 9728 provides in relevant part as follows:
(a) General rule. 
(1) Except as provided in subsection (b)(5),[[2]] all restitution, reparation, fees, costs, fines and penalties shall be collected by the county probation department or other agent designated by the county commissioners of the county with the approval of the president judge of the county for that purpose in any manner provided by law. However, such restitution, reparation, fees, costs, fines and penalties are part of a criminal action or proceeding and shall not be deemed debts....
....
(g) Costs, etc.  Any sheriff's costs, filing fees and costs of the county probation department, clerk of courts or other appropriate governmental agency, including any reasonable administrative costs associated with the collection of restitution, shall be borne by the defendant and shall be collected by the county probation department or other appropriate governmental agency along with the total amount of the judgment and remitted to the appropriate agencies at the time of or prior to satisfaction of judgment. (Emphasis added.)
It is well settled that statutes or parts of statutes are in pari materia when they relate to the same persons or things or to the same class of persons or things; as such they must be construed together as one statute, if possible. See Section 1932 of the Statutory Construction Act of 1972, 1 Pa.C.S. § 1932.
In Commonwealth v. Gaddis, 432 Pa.Super. 523, 639 A.2d 462 (1994), the defendant challenged the sentencing court's imposition of $137,500 in costs incurred by the Cambria County Children and Youth Services (CYS) for child foster and placement care and for psychiatric and psychological assistance to the victims *1052 of the defendant's crimes. The Superior Court examined the application of Section 9728(a), (b)[3] and (g) of the Sentencing Code, and it concluded as follows:
A clear reading of section 9728 indicates that subsections (a) and (b) govern the status of restitution, reparation, fees, costs, fines and penalties imposed as part of sentencing or pretrial disposition, and the manner in which judgment for same may be entered with the prothonotary against a defendant. Restitution, reparation, fees, costs, fines and penalties are not delineated in separate subsections of section 9728, but are all contained in subsection (a). Therefore, we agree with appellant that the separate reference to "costs" in subsection (g) provides for the collection of costs associated with obtaining a money judgment against the defendant, and does not provide for the imposition of the costs of prosecution itself, as the sentencing court in this case envisioned.

Moreover, we do not find that the imposition of the expenses of [CYS] on appellant in this case was proper, even under section [9728](a). The statute states: "A sentence ... for restitution, reparation, fees, costs, fines or penalties shall... be a judgment in favor of the probation department upon the person or the property of the person sentenced...." Id., § 9728(a) (emphasis added). Any monies collected from appellant, then, could not satisfy the CYS costs, as only the ... Probation Department would be a judgment holder under section 9728.
Id. at 472-73 (emphasis added). The Superior Court noted that clear statutory authority exists for the imposition of costs for the care, support and maintenance of children under the supervision of the court or CYS, and it therefore concluded that the trial court erred in imposing the CYS costs pursuant to Section 9728(g).
With respect to costs of prosecution, Section 1403 of The County Code, Act of August 9, 1955, P.L. 323, as amended, 16 P.S. § 1403, provides:
All necessary expenses incurred by the district attorney or his assistants or any office directed by him in the investigation of crime and the apprehension and prosecution of persons charged with or suspected of the commission of crime, upon approval thereof by the district attorney and the court, shall be paid by the county from the general funds of the county. In any case where a defendant is convicted and sentenced to pay the costs of prosecution and trial, the expenses of the district attorney in connection with such prosecution shall be considered a part of the costs of the case and be paid by the defendant.
The Clerk does not dispute that the sheriff's transportation costs do not fall within the meaning of "costs of prosecution" as referred to in Section 1403, and he also acknowledges that other statutory provisions impose the sheriff's transportation costs upon the counties. For example, Section 13 of the Sheriff Fee Act, Act of July 6, 1984, P.L. 614, as amended, 42 P.S. § 21113, provides:
For attending court, when required to do so by law or by a judge or district attorney, or bringing into or removing therefrom prisoners for arraignment, trial or sentence or witnesses held in custody, an hourly rate equivalent to the prevailing wage scale of the performing sheriff's office shall be paid by the county *1053 for each deputy or special deputy actually present.
Section 11 of the Act of December 22, 1969, P.L. 394, 61 P.S. § 461.11, provides that "[t]he cost of transporting prisoners committed to the detention facilities shall be paid by the counties, respectively, from which the prisoners are committed." Finally, Section 5 of the Act of April 16, 1845, P.L. 507, 61 P.S. § 345, provides that "[t]he expenses of conveying convicts from the several counties of this Commonwealth to the eastern and western penitentiaries shall be paid by the counties from which such convicts may be sent...."
It is clear that fines and costs imposed by a sentencing court constitute penal sanctions, Commonwealth v. Larsen, 452 Pa.Super. 508, 682 A.2d 783 (1996), and that statutory provisions governing the imposition of the costs of prosecution must be strictly construed. See Section 1928(b)(1) the Statutory Construction Act of 1972, 1 Pa.C.S. § 1928(b)(1); Commonwealth v. Diakatos, 708 A.2d 510 (Pa.Super.1998); Gaddis. Under the rule of strict construction, the Court concludes that the transportation costs assessed against Fordyce do not fall within the meaning of "costs of prosecution" as that term is referred to in Section 1403 of The County Code and in Section 9728(a) and (b) of the Sentencing Code.
Relying on Larsen, the Clerk nevertheless argues that the statutory provisions requiring the counties to pay the sheriff's transportation costs merely allocate those costs to the counties and that the counties still have the right to recoup those costs from Fordyce. The defendant in Larsen was charged with drug-related offenses after a grand jury investigation, and, in sentencing the defendant upon his conviction, the trial court imposed prosecution costs of $38,875.16. The defendant argued that the prosecution costs were improper because Section 4553(b) of the Investigating Grand Jury Act (IGJA), as amended, 42 Pa.C.S. § 4553(b), required the Commonwealth to pay "[t]he expenses of any multicounty investigating grand jury" and "the costs and expenses resulting from any trial of a person" following the grand jury investigation but was silent as to the obligation to reimburse those costs to either the county or the Commonwealth. The Superior Court rejected the defendant's argument, holding that "where IGJA leaves off (by making no mention of the consequences flowing from a grand jury presentment  conviction), the common law takes over and obligates a defendant to answer for the costs of prosecution with conviction." Larsen, 682 A.2d at 796 (emphasis added) (footnote omitted). In so holding, the Superior Court indicated that under both Section 4533(b) of the IGJA and Section 1403 of The County Code, "the initial costs associated with the investigatory and prosecutorial courses pursued by the government are to be paid by the county" and that "[u]ltimate reimbursement occurs to said entity ... when and if the defendant is convicted...." Id. at 796 n13.
It was undisputed that in Larsen the costs imposed by the trial court as part of the sentencing order represented the "costs of prosecution," which the defendant was obligated to reimburse under Section 1403 of The County Code and the common law. Unlike the costs in Larsen, however, the sheriff's transportation costs are not part of the costs of prosecution imposed by the sentencing court under Section 1403 of The County Code and Section 9728(a) and (b) of the Sentencing Code, and, moreover, clear statutory authority already exists for the imposition of costs associated with transporting prisoners. Gaddis. Because the costs imposed by the sentencing court in this case do not fall within the costs of *1054 prosecution as contemplated by the applicable statutes, Larsen is inapplicable. Hence, the trial court erred in sustaining the demurrer, and its order accordingly is reversed.

ORDER
AND NOW, this 7th day of February, 2005, the order of the Court of Common Pleas of the Thirty-Seventh Judicial District, Forest County Branch, in the above-captioned matter is reversed.
NOTES
[1]  The trial court also directed the Clerk to determine whether the sheriff's transportation costs were assessed correctly. The Clerk thereafter submitted a breakdown of the sheriff's costs of $300.26, which included deputy sheriff's fees, mileage and meals.
[2]  Subsection (b)(5) authorizes the county correctional facility or the Department of Corrections to deduct money from an inmate's personal account for the purpose of collecting restitution or court-ordered obligation.
[3]  Subsection (b) sets forth the procedures for collecting restitution, reparation, fees, costs, fines and penalties.
