On September 30, 1960, the petitioner was convicted of first degree murder and was sentenced to life imprisonment. On May 25, 1965, he was found guilty of aggravated assault and was sentenced to five years in the state penitentiary, to commence when he had completed serving the sentence for murder.
Having attempted without success to challenge his murder conviction on federal constitutional grounds in the state courts, the petitioner sought a writ of habeas corpus in the United States District Court for the Southern District of Florida. He contended that he had been deprived of counsel at his preliminary hearing, that a coerced confession had been used against him at trial, and that he had been denied the right to an effective appeal.
*336The District Court observed that, even if the petitioner's contentions were accepted and his murder conviction reversed, he would still face a five-year prison term for aggravated assault. Because a favorable decision on the murder conviction would not result in the petitioner's immediate release from prison, the District Court thought itself powerless to consider the merits of his claims and therefore denied his habeas corpus petition without further consideration. In short, the District Court held that the petitioner could not challenge his life sentence until after he had served it. The United States Court of Appeals for the Fifth Circuit summarily rejected the petitioner’s application for a certificate of probable cause, and he then sought review in this Court.
In reaching its conclusion, the District Court relied upon McNally v. Hill, 293 U. S. 131, for the broad proposition that the “Writ of Habeas Corpus may not be used as a means of securing judicial decision of a question which, even if determined in the prisoner’s favor, could not result in his immediate release.” The McNally decision, however, held only that a prisoner cannot employ federal habeas corpus to attack a “sentence which [he] has not begun to serve.” 293 U. S., at 138. Here the District Court has turned that doctrine inside out by telling the petitioner that he cannot attack the life sentence he has begun to serve — until after he has finished serving it. We need not consider the continued vitality of the McNally holding in this case, for neither McNally nor anything else in our jurisprudence can support the extraordinary predicament in which the District Court has placed this petitioner.
Whatever. its other functions, the great and central office of the writ of habeas corpus is to test the legality of a prisoner’s current detention. The petitioner is now serving a life sentence imposed pursuant to a conviction for murder. If, as he contends, that conviction *337was obtained in violation of the Constitution, then his confinement is unlawful. It is immaterial that another prison term might still await him even if he should successfully establish the unconstitutionality of his present imprisonment.
The motion for leave to proceed in forma pauperis and the petition for certiorari are granted, the judgment is reversed, and the case is remanded to the District Court for further proceedings consistent with this opinion.
It is so ordered.