Opinion by
Rhodes, P. J.,This appeal by relator is from an order dismissing his petition for writ of habeas corpus.
The petition was filed on November 16, 1954,1 and, although it was captioned in the Court of Common Pleas of Schuylkill County, it was inadvertently marked filed in the court of quarter sessions. Answer was filed thereto by the District Attorney of Schuylkill County. We shall treat the appeal the same as if the proceeding had been properly docketed in the court of common pleas and disposed of therein, as it should have been. Act of May 25,1951, P. L. 415, §1, 12 PS §1901.
The real purpose of the application for the writ was to make a sentence imposed by the Court of Oyer and Terminer of Schuylkill County on January 17, 1949 (No. 324, May Term, 1948),2 on a conviction for armed *326robbery, for a term of imprisonment of not less than ten years nor more than twenty years in the Eastern State Penitentiary, concurrent with a sentence imposed by the Court of Oyer and Terminer of Lackawanna County on November 29, 1948 (No. 7, May Term, 1948), for a similar term and for a similar offense.
Relator’s contentions are that the Act of May 28, 1937, P. L. 1036, §1, 19 PS §894, requires the sentence imposed by the Court of Oyer and Terminer of Schuylkill County to begin on March 4, 1948, when he was first committed to the Schuylkill County prison; and that the sentence being directed to commence at the expiration of sentences theretofore imposed was illegal.3 Our decision is confined to the question raised on this appeal.
Relator was arrested in Schuylkill County on March 3, 1948, and charged with armed robbery. He was committed to the Schuylkill County prison in default of bail on March 4, 1948. On March 8, 1948, he was removed to Lackawanna County as he was charged with the commission of armed robberies in that county. It appears that his removal to Lackawanna County from the Schuylkill County prison was by virtue of a writ of habeas corpus ad prosequendum directed to the *327warden of the Schuylkill County prison. After being given a preliminary hearing he was returned to the Schuylkill County prison on March 10, 1918. He was subsequently indicted by a grand jury in Lackawanna County for several robberies.
On April 21, 1918, relator was indicted by a grand jury in Schuylkill County for armed robbery; he was tried and convicted on this indictment (No. 321, May Term, 1918) on May 13, 1918; he filed, by his counsel, motions for a new trial and in arrest of judgment on May 17, 1918. Sentence was deferred pending disposition of the motions.
On September 28, 1918, relator escaped from the Schuylkill County prison. He was later apprehended and charged Avith prison breach (No. 715, November Term, 1918, in the Court of Quarter Sessions of Schuylkill County).
Relator remained in the Schuylkill County prison until October 1, 1918, when he was removed to Lackawanna County pursuant to a Avrit of habeas corpus issued by the Court of Oyer and Terminer of Lackawanna County to the Avarden of the Schuylkill County prison. The writ directed relator’s removal to Lackawanna County to answer the charges of robbery for which he had been indicted and at the conclusion of the trial to be returned to the Schuylkill County prison. Relator was tried and convicted on October 9, 1918, in the Court of Oyér and Terminer of Lackawanna County. He was sentenced by that court on November 29,1918, to undergo imprisonment in the Eastern State Penitentiary for a term of not less than ten years nor more than twenty years. It was noted that he had been committed to the Lackawanna County jail on October 1, 1918.
*328On December 7,1948, he was returned to the Schuylkill County prison. He had been indicted on October 25, 1948, in Schuylkill County on the charge of prison breach. He entered a plea of guilty to this indictment on January 3, 1949, and was sentenced as follows: “pay costs, fine $1.00, serve not less than 1 nor more than 2 years in Eastern Penitentiary at expiration of any sentence to which defendant is now sentenced, to stand committed.”
On November 22, 1948, relator by his counsel filed additional reasons for a ne^ trial following his conviction for armed robbery on May 13, 1948, at No. 324, May Term, 1948, in the Court of Oyer and Terminer of Schuylkill County. The matter was argued before the Schuylkill County court on December 13, 1948. On January 3, 1949, relator’s motions for a new trial and in arrest of judgment were overruled, and relator was directed to appear subsequently for sentence which was imposed on January 17, 1949. No appeal was taken from the judgment of sentence. On January 18, 1949, he was transferred to the Eastern State Penitentiary, where he is confined, to serve the following sentences: (1) November 28, 1948, by the Court of Oyer and Terminer of Lackawanna County, for armed robbery, at No. 7, May Term, 1948, ten to twenty years from October 1, 1948; (2) January 3, 1949, by the Court of Quarter Sessions of Schuylkill County, for prison breach, at No. 715, Novembér Term, 1948, one to two years after expiration of (1); (3) January 17, 1949, by the Court of Oyer and Terminer of Schuylkill County, for armed robbery, at No. 324, May Term, 1948, ten to twenty years after expiration of (1) and (2).
Relator recognizes the validity of sentence imposed by the Court of Oyer and Terminer of Lackawanna County, but contends that the sentence of the Court of Oyer and Terminer of Schuylkill County must be as *329of March 4, 1948. He makes no complaint of the allowance on this sentence by Judge Staudenmeier for the time served in Schuylkill County prior to his commitment to the Eastern State Penitentiary, but is concerned only with the beginning of the sentence. The reason for this is clear for if he prevails in this respect the sentence by the Court of Oyer and Terminer of Schuylkill County will be virtually nullified. He will be serving, contrary to the intention of that court, concurrent sentences.
Courts have inherent power to fix the time of the beginning of service of sentences imposed, which cannot be taken away except by express and unequivocal statutory enactment. Com. ex rel. Hill v. Burke, 165 Pa. Superior Ct. 583, 587, 69 A. 2d 169. The Court of Oyer and Terminer of Schuylkill County was not deprived of this power as to relator by the Act of May 28, 1937, P. L. 1036. Section 1 of this act, 19 PS §894, provides: “From and after the passage of this act, all sentences for criminal offenses of persons who at the time sentence is imposed are held in custody in default of bail, or otherwise, shall begin to run and be computed from the date of commitment for the offense for which said sentence shall be imposed, unless the person sentenced shall then be undergoing imprisonment under a sentence imposed for any other offense or offenses, in which case the Said sentence shall begin to run and be computed, either from the date of imposition thereof or from the expiration of such other sentence or sentences, as the court shall, in its discretion, direct.”
By this act relator was entitled to credit on his sentence for the period of actual imprisonment before imposition of sentence. But there is no merit in the argument that his sentence at No. 324, May Term, 1948, automatically began on March 4, 1948, the day of commitment to the Schuylkill County prison, whereby it *330would run concurrently with sentences imposed after that date. Under the circumstances, the Court of Oyer and Terminer of Schuylkill County could make the sentence at No. 324, May Term, 1948, imposed January 17, 1949, run consecutively to other outstanding sentences. Relator is entitled to credit only for the time spent in confinement between arrest and sentence, the confinement being by reason of the offense for which sentence is imposed. Com. ex rel. Lerner v. Smith, 151 Pa. Superior Ct. 265, 270, 30 A. 2d 347; Com. ex rel. Accobacco v. Burke, 162 Pa. Superior Ct. 592, 60 A. 2d 426; Com. ex rel. Harman v. Burke, 171 Pa. Superior Ct. 547, 554, 91 A. 2d 385; Com. ex rel. Geisler v. Claudy, 172 Pa. Superior Ct. 281, 93 A. 2d 873. The sentence imposed by the Court of Oyer and Terminer of Lackawanna County on November 29, 1948, recognized credit from October 1, 1948. For the period of imprisonment in Schuylkill County prior thereto, he was entitled to credit on the sentence imposed on January 17, 1949, by the Court of Oyer and Terminer of Schuylkill County. See Com. ex rel. Spanos v. Keenan, 176 Pa. Superior Ct. 245, 107 A. 2d 593. He was originally detained in the Schuylkill County prison on March 4, 1948, in default of bail. The delay in imposing sentence after his conviction on the charge of armed robbery in Schuylkill County was due to his pending motions for a new trial and in arrest of judgment. Intervening prosecutions resulted in other convictions and sentences. When ' imposing sentence on January 17, 1949,' the Court of Oyer and Terminer of Schuylkill County recognized those prior sentences in fixing the time of the beginning of service of the last sentence. But it was not required to make such sentence concurrent with the prior existing sentences for other crimes, although it could not deprive relator of credit for actual imprisonment preceding imposition of that sentence *331and attributable to the offense for which he was being sentenced. See Com. ex rel. Accobacco v. Burke, supra, 162 Pa. Superior Ct. 592, 598, 60 A. 2d 426.
The objective of the Act of May 28, 1937, P. L. 1036, 19 PS §894 et seq., is clear. In regulating and prescribing the computation of sentences, it does not preclude punishment for criminal offenses for which a defendant has been convicted.
The commitment is amended to provide for credit on sentence at No. 324, May Term, 1948, from March 4, 1948, to October 1,1948, to wit, two hundred ten days.
The sentence for prison breach pronounced after a plea of guilty on January 3, 1949, at No. 715, November Term, 1948, by the Court of Quarter Sessions of Schuylkill County is not directly involved on this appeal. Relator was not under sentence at the time of this offense, and the first provision of section 309 of the Act of June 24, 1939, P. L. 872, 18 PS §4309, was applicable. See Com. ex rel. Gibbs v. Ashe, 165 Pa. Superior 35, 40, 67 A. 2d 773. It was permissible for the court to direct that the sentence for prison breach should be served consecutively to the sentence at No. 7, May Term, 1948, which was then outstanding, having been imposed on November 29, 1948, by the Court of Oyer and Terminer of Lackawanna County. It is obvious that otherwise there would be no punishment for the escape other than the imposition of a sentence which would'be concurrent. The court had inherent power to make the sentence for prison breach consecutive to the sentence for the crime of armed robbery committed in Lackawanna County.
As modified, the order of the court below is affirmed.
Relator’s petition was entitled “Motion to Arrest Judgment.” It was treated as a petition for writ of babeas corpus by tbe District Attorney of Schuylkill County and by Judge Statjdenmeier before whom tbe matter came for disposition.
Tbe sentence is as follows: “The defendant, Joseph Rogers, is now sentenced to pay the costs of prosecution, pay a fine of *326$1.00; serve in the State Penitentiary for the Eastern District, by separate or solitary confinement at labor for an indeterminate period; and the minimum time of said imprisonment is fixed at ten (10) years and the maximum is twenty (20) years. Sentence to commence at the expiration of sentences heretofore imposed upon you.”
To correct an illegal sentence a prisoner is entitled to a writ of habeas corpus. Com. ex rel. Scasserra v. Keenan, 175 Pa. Superior Ct. 443, 445, 106 A. 2d 842; Com. ex rel. Winkler v. Claudy, 174 Pa. Superior Ct. 239, 241, 101 A. 2d 430; Com. ex rel. McGinnis v. Ashe, 330 Pa. 289, 293, 199 A. 185.