delivered the opinion of the court.
The petitioner herein was sentenced by the District Court of San Juan to a term of twelve years in the penitentiary for murder in the second degree. The judgment was rendered on September 4, 1935. On February 29, 1940, the petitioner was discharged on a writ of habeas corpus issued by the District Court of San Juan on the ground that the *87accused Rad not been assisted by counsel. On March 25 of the same year, the petitioner was rearrested and confined in the District Jail of Guayama on a charge of voluntary manslaughter based on the same facts as those of the former information. On April 23, 1940, the petitioner pleaded guilty to the charge of voluntary manslaughter, was sentenced to eight years’ imprisonment, and was confined in the insular penitentiary where he is detained at present.
On December 29, 1941, the District Court of San Juan granted a petition for habeas corpus filed by the petitioner herein, and ordered that he be forthwith discharged. The ground of said petition was that, as the petitioner had maintained good behavior during the whole time of his confinement, which entitled ,him to, reductions in the penalty as provided by the Act of March 14, 1907 (Comp. Stat. 1911, §§ 6362-6364), and as he had been confined for 5 years, 11 months, and 12 days, the 8-year sentence imposed on him had expired on July 27,1941, when the petitioner should have been discharged.-
In his petition filed in this court, the petitioner alleges that, notwithstanding the order discharging him made by the District Court of San Juan, the Warden of the -Insular Pen-intentiary still unlawfully detains him and deprives him of his liberty on the grounds that said order is not final, and that he is bound to execute the same only upon its affirmance by the Supreme Court after hearing the appeal taken by The People of Puerto Rico.
Conceding, without holding, that the district attorney is entitled to appeal from an order whereby a prisoner is discharged on the ground that the latter has served the sentenced imposed on him, the question to be determined, which is not new in this jurisdiction, is whether the taking of an appeal by the district attorney, from an order discharging a prisoner who has served his sentence stays the execution of the order appealed from.
*88Appeals in habeas corpus proceedings are governed by the provisions of the Act providing for the writ of habeas corpus, approved March 12, 1903 (Comp. Stat. 1911, §§ 6547-6556). Section 1 thereof grants to “any party to the proceedings aggrieved thereby” the right to appeal to this court from a final, order made therein. Section 2 provides that the district attorney may appeal in the name of the People of Puerto Eico “from a final order discharging a prisoner committed upon a criminal accusation,” and it further provides that an appeal taken from an order admitting a prisoner to bail or reducing the amount thereof shall not operate as a stay.
In López v. Court, 40 P.R.R. 478, 480, it was held that the writ of habeas corpus “is essentially and historically a proceeding to obtain the liberty of the person under custody,” and that appeals in habeas corpus proceedings are governed by the Act of March 12, 1903. Construing the meaning and scope of said act, this court said:
“Nevertheless, we find nothing in the whole body of the law that shows any intention of suspending execution when a prisoner is discharged or the custody of a child is obtained. Section 2 only lays emphasis on certain cases.
“We likewise agree with the petitioner that when the ‘liberty’ or change of custody is decreed, justice would require that the judgment of the court, presumptively right, be carried into effect.”
In accordance with the provisions of § 491 of the Code of Criminal Procedure, 1935 ed., no person who has been discharged, upon habeas corpus can be again imprisoned for the same cause, except when committed by legal order or process or where, after a discharge for defect of proof or for any defect of the process or warrant, he is again -arrested on sufficient proof and committed by legal process for the same offense.
In People ex rel. Sabatino v. Jennings, 246 N. Y. 258, 63 A.L.R. 1458, the warden of the penitentiary, as in the case *89at bar, refused to release a prisoner from custody on the gronnd that the order of discharge had been suspended by the taking of an appeal, under § 570 of the Civil Practice Act. The New York Court of Appeals, through Mr. Chief Justice Carduzo, decreed the immediate discharge of the prisoner, saying:
• • That section has no application to an appeal by a State officer from an order directing the unconditional discharge of a prisoner upon a writ of habeas corpus. The pertinent section in such a situation is section 1269, which provides that ‘a. prisoner who has been discharged by a final order made upon a writ of habeas corpus or certiorari . . . shall not be again imprisoned, restrained, or kept in custody, for the same cause. ’ It would be intolerable that a custodian adjudged to be at fault, placed by the judgment of the court in the position of a wrongdoer, should automatically, by a mere notice of appeal, prolong the term of imprisonment, and frustrate the operation of the historic writ of liberty. ‘The great purpose of the writ of habeas corpus is the immediate delivery of the party deprived of personal liberty’ (Shaw, Ch. J., in Wyeth v. Richardson, 10 Gray, 240). ... A statute suspending the effect of the discharge by the mere force of an appeal would be, at war with the mandate of the Constitution whereby the writ of habeas corpus is preserved in all its ancient plenitude (Const, art. 1, §4). ‘The writ cannot be abrogated, or its efficiency curtailed, by legislative action’ (citing authorities). Little would be left of ‘this, the greatest of all writs’ if a jailer were permitted to retain the body of his prisoner during all the weary processes of an appeal begun without leave and languidly continued.
< ‘ # # # # * * #
“We hold that the notice of appeal to this court is ineffective as a stay, that the order of discharge retains its binding force, that no bail or recognizance is required or permissible, and that it is the duty of the warden forthwith to release the prisoner until the appeal shall be determined.”
Whether or not the district court proceeded in accordance with the law when it decreed that the petitioner be discharged, is a matter which we will decide after the appeal taken by The People of Puerto Rico has been perfected and heard. The only thing which we now decide is that the de*90tention of the petitioner after the issuance of the order decreeing his discharge is illegal and, therefore, that the proper thing to do is to grant the petition and issue the writ sought and order that petitioner Pedro Muñoz Bosado be forthwith discharged. '