# § 872. Habeas corpus; mandamus; suit to restrain assessment or collection of taxes
The supreme and district courts of Puerto Rico and the respective judges thereof may grant writs of habeas corpus in all cases in which the same are grantable by the judges of the district courts of the United States, and the district courts may grant writs of mandamus in all proper cases.
No suit for the purpose of restraining the assessment or collection of any tax imposed by the laws of Puerto Rico shall be maintained in the United States District Court for the District of Puerto Rico.
---
**Source Credit**: (Mar. 2, 1917, ch. 145, § 48, 39 Stat. 967; Mar. 4, 1927, ch. 503, § 7, 44 Stat. 1421; May 17, 1932, ch. 190, 47 Stat. 158.)
## Editorial Notes
### Codification
“United States District Court for the District of Puerto Rico” substituted in text for “District Court of the United States for Puerto Rico” in view of , Judiciary and Judicial Procedure, which states that “There shall be in each judicial district a district court which shall be a court of record known as the United States District Court for the district” and which states that “Puerto Rico constitutes one judicial district”.
### Amendments
1927—Act , added second paragraph.
## Statutory Notes and Related Subsidiaries
### Change of Name
“Puerto Rico” substituted in text for “Porto Rico” pursuant to act , which is classified to .