Matthews has appealed from the district court’s denial of his petition for a writ of habeas corpus. In that petition, and on appeal, Matthews raises only one contention: that he is entitled to have his nineteen-year sentence for attempted murder reduced to take into account the time he served in jail prior to sentencing because he was unable to post bond. In Louisiana the maximum sentence for attempted murder is twenty years. Matthews contends that because his indigency prevented his release before sentencing, he will be denied equal protection unless he receives credit for that incarceration.
The district court’s finding that Matthews was unable to post bail because of his indigency is not challenged on appeal. The only issue, then, is whether Matthews must be credited with the time which he spent in jail prior to being sentenced.
Matthews was arrested on April 30, 1966, and found guilty by a jury on April 13, 1967. He was not sentenced, however, until September 17, 1968. Thus, he served 28 months and 18 days in jail prior to being sentenced. When that time is added to his sentence of nineteen years, the total time he will have spent in prison exceeds the twenty years which the legislature has established as a maximum for the crime of attempted murder. If he is not credited with at least part of the time spent in jail prior to sentencing, he will serve in excess of the statutory maximum solely because of his indigency. Such a result is not permissible under the Constitution. See Williams v. *931Illinois, 399 U.S. 235, 90 S.Ct. 2018, 26 L.Ed.2d 586 (1970). As this court explained in Hart v. Henderson, 449 F.2d 183 (5th Cir. 1971) , “the inability of an indigent criminal defendant to make bond should not result in extending the duration of his imprisonment' beyond the statutory maximum.” Id. at 185.
Stating the principle does not, however, resolve the issue in this case. A special problem arises here in determining whether Matthews is entitled to credit for the entire period of pre-sentencing imprisonment or only for that period which, when added to his nineteen-year sentence, would make him serve over the maximum twenty years. None of our previous cases has involved a situation such as this, where the judge imposed a sentence which was less than the maximum but which, when added to the time already spent in prison, exceeded the maximum. In some cases the statutory maximum exceeded the total of the sentence and the pre-sentencing imprisonment. Jackson v. Alabama, 530 F.2d 1231 (5th Cir. 1976); Gremillion v. Henderson, 425 F.2d 1293 (5th Cir. 1970). For those cases we were able to establish a “conclusive presumption that the sentencing judge gave credit for the pre-sentence custody.” Parker v. Estelle, 498 F.2d 625, 627 (5th Cir. 1974), cert. denied, 421 U.S. 963, 95 S.Ct. 1951, 44 L.Ed.2d 450 (1975). In other cases the trial judge sentenced the defendant to the maximum period even though there had been a period of pre-sentencing custody. Hill v. Wainwright, 465 F.2d 414 (5th Cir. 1972) ; Hart v. Henderson, supra. For those cases we established a different rule, one which held that “a state prisoner who has received the maximum imposable prison sentence for an offense must be given credit for all pre-sentence jail time if he was unable to make bail due to his indigence.” Hill v. Wainwright, supra, 465 F.2d at 415.
This case falls between the two rules. Because the sum of the sentence and the pre-sentence custody exceeds the statutory maximum, there is no room for a presumption, conclusive or otherwise, that the sentencing judge gave credit for the pre-sentence custody. Cf. Parker v. Estelle, supra. Similarly, since Matthews did not receive the maximum possible sentence, the rule of Hill v. Wainwright cannot control. The precedents do, however, make clear that it is the excess of total imprisonment over the statutory maximum with which the courts are concerned. Parker v. Estelle emphasized that concern in these words: “although there is no absolute right to pre-sentence detention credit, a denial of such credit due to a defendant’s poverty (e. g., the financial inability to make bail) or to some other constitutionally impermissible basis will not be allowed to extend a state prisoner’s sentence beyond the maximum prescribed for the crime.” 498 F.2d at 627 (emphasis in original). It is still the rule in this circuit that “ ‘there is no federal constitutional right to credit for time served prior to sentence,’ and in the absence of a state statute the granting of such credit is within the discretion of the sentencing judge.”1 Jackson v. Alabama, supra, 530 F.2d at 1235 (quoting Gremillion, supra, 425 F.2d at 1294). There is, however, a federal constitutional right not to be subjected to imprisonment beyond the statutory maximum solely because of indigency. See Williams v. Illinois, supra, 399 U.S. at 241-42, 90 S.Ct. at 2022. Thus, we conclude that Matthews would be denied equal protection if he were incarcerated for a total period which exceeded twenty years. He is therefore entitled to credit for 16 months and 18 days of the confinement served before sentencing due to indigency.
The district court’s order denying the motion for habeas corpus is reversed and the cause is remanded with directions that the writ be issued in accordance with this opinion.
REVERSED AND REMANDED.
. Louisiana now has such a statute, but it does not apply to Matthews’ sentence which was imposed prior to its enactment. La.Code Crim. Pro.Ann. art. 880 (West Supp.1978). State v. Williams, 262 La. 769, 264 So.2d 638 (La. 1972); cf. Jackson v. Alabama, 530 F.2d 1231, 1237-38 (5th Cir. 1976).