
941 A.2d 70 (2007)
Creighton L. LAWRENCE, Petitioner
v.
PENNSYLVANIA DEPARTMENT OF CORRECTIONS, Respondent.
No. 230 M.D. 2007.
Commonwealth Court of Pennsylvania.
Submitted on Briefs September 14, 2007.
Decided October 25, 2007.
Creighton L. Lawrence, petitioner, pro se.
Vincent R. Mazeski, Asst. Counsel and Suzanne N. Hueston, Chief Counsel, Camp Hill, for respondent.
Before: SMITH-RIBNER, Judge, and SIMPSON, Judge, and McCLOSKEY, Senior Judge.
OPINION BY Judge SIMPSON.
Before this Court in our original jurisdiction is the preliminary objection of the *71 Department of Corrections (DOC) to a petition for review in the nature of mandamus filed by inmate Creighton L. Lawrence, representing himself. DOC challenges the legal sufficiency of the petition asserting Lawrence lacks a clear right to the credit he seeks on his new sentence. We sustain DOC's demurrer.
In his mandamus petition, Lawrence avers the following facts. On March 14, 2006, the Court of Common Pleas of Clearfield County (sentencing court) sentenced Lawrence to serve three months to two years in a state institution for committing forgery, concurrent with all other periods of incarceration (new state sentence). The sentencing court also ordered Lawrence to serve concurrently two years' probation for tampering with physical evidence. Notwithstanding the sentencing court's order for concurrency, DOC refuses to credit Lawrence's new state sentence for time he is currently serving. Lawrence alleges DOC refuses the credit because he must first serve time on "the original committed sentence and parole to the underlying imposed sentence." DOC's failure to properly credit Lawrence's new state sentence prevents him from seeking parole and causes him undue punishment and incarceration.
Significantly, Lawrence attached several documents to his petition for review. The most important is Exhibit B, DOC's Sentence Status Summary form. This form reveals that in 2003, the Court of Common Pleas of Jefferson County imposed a one to five year sentence for a violation of probation and criminal mischief (original state sentence). Pet. for Review, Ex. B at 1. The original state sentence had a minimum date of June, 2004, and a maximum date of June, 2008. Id. at 2 (Sentence Structure). Lawrence was apparently paroled from the original state sentence after his minimum in June, 2004. Id. at 1 (Remarks). At the point of parole, he would remain under state parole supervision until the expiration of his maximum date under the original state sentence, June, 2008.
After Lawrence's March 2006 convictions in Clearfield County for forgery and tampering with physical evidence, the Pennsylvania Board of Probation and Parole (Board) recommitted Lawrence as a convicted and technical parole violator to serve the remainder, of his original state sentence. Id. at 1 (Remarks: Version 5) and 2 (Backtime Owed). As a result of the Board-imposed backtime on the original state sentence and the new state sentence, DOC recalculated Lawrence's maximum term expiry as March 29, 2009. Id. at 2.
Claiming DOC disregarded the sentencing court's order, Lawrence seeks an order directing DOC to properly credit his new state sentence with backtime served on the original state sentence. He relies on Parish v. Horn, 768 A.2d 1214 (Pa.Cmwlth. 2001), aff'd, 569 Pa. 45, 800 A.2d 294 (2002).
In response, DOC filed a preliminary objection in the nature of a demurrer. In considering a demurrer, we accept as true all well-pled material allegations in the petition, as well as all inferences reasonably deducible from the allegations. Aviles v. Dep't of Corr., 875 A.2d 1209 (Pa.Cmwlth.2005). In addition, courts reviewing preliminary objections may not only consider the facts pled in the complaint, but also documents or exhibits attached to it. Diess v. Pa. Dep't of Transp., 935 A.2d 895 (Pa. Cmwlth.2007); see Philmar Mid-Atlantic, Inc. v. York Street Assocs. II, 389 Pa.Super. 297, 566 A.2d 1253 (1989) (in the context of a demurrer it is not necessary to accept as true averments in the complaint that conflict with exhibits attached to it). A demurrer must be sustained where it is clear and free from doubt the law will not permit recovery *72 under the alleged facts; any doubt must be resolved by a refusal to sustain the demurrer. Kretchmar v. Commonwealth, 831 A.2d 793 (Pa.Cmwlth.2003).
A proceeding in mandamus is an extraordinary remedy at common law, designed to compel the performance of a ministerial act or mandatory duty. Detar v. Beard, 898 A.2d 26 (Pa.Cmwlth.2006). "The purpose of mandamus is not to establish legal rights, but to enforce those rights already established beyond peradventure." Id. at 29. This Court may only issue a writ of mandamus where the petitioner possesses a clear legal right to enforce the performance of a ministerial act or mandatory duty, the defendant possesses a corresponding duty to perform the act, and the petitioner possesses no other adequate or appropriate remedy. Id. Mandamus can only be used to compel performance of a ministerial duty and will not be granted in doubtful cases. Id.; Doxsey v. Commonwealth, 674 A.2d 1173 (Pa. Cmwlth.1996).
A writ of mandamus will lie to compel DOC to properly compute an inmate's prison sentence. Saunders v. Dep't of Corr., 749 A.2d 553 (Pa.Cmwlth.2000); Doxsey. "No one, however, has a right and this Court, indeed, lacks the authority to compel an illegal act." Doxsey, 674 A.2d at 1175. Mandamus is therefore not available to compel the DOC's compliance with an illegal sentencing order. Id.
Here, DOC contends Lawrence lacks a clear right to relief because the sentencing court's imposition of the new state sentence to run concurrent with Board-imposed backtime on the original state sentence violates statutory law. We agree.
In relevant part and with added emphasis, Section 21.1(a)(1) of the act commonly known as the Parole Act[1] provides:
(a) Convicted Violators. Any parolee under the jurisdiction of the Pennsylvania Board of Parole released from any penal institution of the Commonwealth who, during the period of parole or while delinquent on parole, commits any crime punishable by imprisonment, from which he is convicted or found guilty by a judge or jury or to which he pleads guilty or nolo contendere at any time thereafter in a court of record, may, at the discretion of the board, be recommitted as a parole violator. If his recommitment is so ordered, he shall be reentered to serve the remainder of the term which said parolee would have been compelled to serve had he not been paroled, and he shall be given no credit for the time at liberty on parole. The board may, in its discretion, reparole whenever, in its opinion, the best interests of the prisoner justify or require his, release on parole and its does not appear that the interests of the Commonwealth will be injured thereby. The period of time for which the parole violator is required to serve shall be computed from and begin on the date that he is taken into custody to be returned to the institution as a parole violator.
If a new sentence is imposed upon such parolee, the service of the balance of said term originally imposed shall precede the commencement of the new term imposed in the following cases:

(1) If a person is paroled from any State penal or correctional institution under the control and supervision of the Department of Justice and the new sentence *73 imposed upon him is to be served in any such State penal or correctional institution.

In Commonwealth v. Dorian, 503 Pa. 116, 468 A.2d 1091 (1983), the. Supreme Court considered the same situation presented here, the imposition of, a new sentence to run concurrent with the time remaining on a prior sentence. Denying a motion to modify the inmate's sentence, the Supreme Court explained: "[t]he [Parole Act] is quite clear that a parole violator convicted and sentenced to prison for another offense must serve his or her back time and the new sentence in consecutive order." Id. at. 117, 468 A.2d at 1092 (quoting Commonwealth v. Zuber, 466 Pa. 453, 457, 353 A.2d 441, 443 (1976)).
Here, Exhibit B reveals the new state sentence was imposed for acts occurring while: Lawrence was on parole from the original state sentence. Pet. for Review, Ex. B. The Board recommitted Lawrence as a convicted parole violator to serve the unexpired term of his original state sentence. Id. Under the Parole Act, Lawrence cannot serve the new sentence before he satisfies his original state sentence. Dorian; LeGrande v, Dep't of Corr., 894 A.2d 219 (Pa.Cmwlth.2006). The sentencing court's imposition of a new concurrent state sentence while Lawrence was serving backtime on the original state sentence violates the Parole Act and is illegal. Lawrence's right to relief is therefore not clear and, as a result, mandamus will not lie.[2]
As a result, we sustain DOC's preliminary objection.[3]
Judge SMITH-RIBNER concurs in the result only.

ORDER
AND NOW, this 25th day of October, 2007, the preliminary objection of the Department of Corrections is SUSTAINED and the petition for review in the nature of mandamus is DISMISSED.
NOTES
[1]  Act of August 6, 1941, P.L. 861, as amended, added by the Act of August 24, P.L. 1401, 61 P.S. § 331.21a(a)(1).
[2]  Lawrence's reliance on Parish v. Horn is misplaced. The issue in Parish was whether the inmate could receive credit against a state sentence while serving, a county sentence which was required to be served before any Board-imposed backtime. Here, the issue is whether Lawrence can receive credit against his new state sentence while serving backtime on an original sentence. In addition, in Detar. we questioned the continued validity of Parish in light of its failure to address cases prohibiting the transfer of credits to sentences in other courts and in view of the express statutory language of 61 P.S. § 21.1(a).
[3]  DOC correctly asserts any relief from the sentencing court's order must be obtained pursuant to the Post Conviction Relief Act, 42 Pa.C.S. §§ 9541-96.
