OPINION
COATS, Judge.Sean A. Walters pled no contest and was convicted of theft in the second degree, a class C felony. AS 11.46.310(a)(2). Superi- or Court Judge James A. Hanson sentenced Walters to a suspended imposition of sentence. Judge Hanson later revoked Walters’ probation based upon his finding that Walters violated the conditions of his probation. Judge Hanson then sentenced Walters to a sentence of imprisonment which was followed by a period of probation. While on probation the second time, Walters was arrested and charged with misconduct involving a controlled substance in the fourth degree, a class C felony. AS 11.71.-040(a)(3)(A). Walters’ probation officer filed a petition to revoke Walters’ probation based on the commission of this subsequent offense. Apparently based upon negotiations with the state, Walters admitted to the violation of his probation and the state dismissed the new charges. Superior Court Judge Victor D. Carlson imposed Walters’ previously suspended sentence. However, Judge Carlson ruled that the Division of Corrections should not give Walters credit for the thirteen days he spent in custody between the time he was arrested for the drug offense and the date the probation officer filed the petition to revoke Walters’ probation. Walters appeals, arguing that he was entitled to credit for serving that time. We agree with Walters and reverse.
Walters sought credit against his sentence under AS 12.55.025(c) which provides in pertinent part:
A defendant shall receive credit for time spent in custody pending trial, sentencing, or appeal, if the detention was in *358connection with the offense for which sentence was imposed.
The state contends that Walters is not entitled to credit for the thirteen days he served after his arrest for the drug offense because the “offense” for which Judge Carlson sentenced Walters was for violating probation for the separate offense of theft in the second degree. We disagree with the state’s reading of the statute for several reasons.
Initially, we do not share the state’s view that AS 12.55.025(c) unambiguously precludes Walters from receiving credit in this ease. It is a well-established principle that any ambiguities in a penal statute must be construed strictly against the state. State v. Andrews, 707 P.2d 900, 907 (Alaska App.1985), aff'd, 723 P.2d 85 (Alaska 1986). In this case, Judge Carlson revoked Walters' probation based upon allegations that Walters committed the drug offense. Since Walters served the thirteen days “in connection with” those drug charges, the plain wording of the statute seems to support the interpretation that Walters is entitled to credit under AS 12.-55.025(c).
Another statute, AS 33.16.240(f), specifically provides that a prisoner must receive credit for “time spent in custody pending revocation proceedings.” While AS 33.16.-240(f) may not technically apply in Walters’ case since the probation revocation petition was not filed until after he had been in custody for thirteen days, this statute also indicates the legislature’s apparent intent to prevent a prisoner from losing credit simply because of the state’s delay in filing formal proceedings against him or because of his inability to make bail. See Thompson v. State, 496 P.2d 651, 656-57 (Alaska 1972); III ABA Standards for Criminal Justice § 18-4.7 and Commentary, at 307-320 (2d ed. 1980).
In concluding that we must give Walters credit for the disputed time, we are also persuaded by the opinions of other courts which have construed statutes similar to AS 12.55.025(c). These courts have concluded that a parolee or probationer who is incarcerated for a substantive crime must receive credit for that time if the parole board subsequently revokes parole or probation based on that crime.1 Gaito v. Pennsylvania Board of Probation and Parole, 488 Pa. 397, 412 A.2d 568, 571 & n. 6 (1980); Smith v. Pennsylvania Board of Probation and Parole, 131 Pa.Cmwlth. 360, 570 A.2d 597, 599 (1990); State v. Ryan, 399 N.W.2d 151 (Minn.App.1987); State v. Doyle, 386 N.W.2d 352 (Minn.App.1986); but see People v. Kane, 136 Ill.App.3d 1030, 91 Ill.Dec. 737, 740-741, 484 N.E.2d 296, 299-300 (5 Dist.1985). In Doyle, which is similar to Walters’ case, Doyle, who was on parole, was arrested for burglary. The state incarcerated Doyle and the parole board held a revocation hearing. However, the parole board did not formally revoke Doyle’s parole until after the trial court sentenced Doyle on the burglary conviction. The Minnesota Court of Appeals pointed out that Doyle had entered into a plea bargain which provided that time which he served on the burglary conviction would be concurrent with time which he received on the parole revocation. The court held that Doyle was entitled to credit for the time which he served while he was awaiting disposition of the burglary charges toward his parole revocation. The court reasoned that Doyle’s custody for the parole violation was “in connection with” the burglary offense. 386 N.W.2d at 354.
We believe that our holding in this case is consistent with the principle that parolees and probationers should be treated with basic fairness. Morrissey v. Brewer, 408 U.S. 471, 484, 92 S.Ct. 2593, 2601, 33 L.Ed.2d 484 (1972); Thompson, 496 P.2d *359at 656-57. In McGinnis v. United States ex rel. Pollack, 452 F.2d 833 (2d Cir.1971), cert. denied 406 U.S. 905, 92 S.Ct. 1606, 31 L.Ed.2d 815 (1972) for example, Pollack was arrested and incarcerated for approximately eighteen months because he was unable to make bail. He ultimately pled guilty and was sentenced to six months. Prior to Pollack’s imprisonment, the parole board issued a warrant for Pollack on a different offense. Had Pollack posted bail, the parole board would have detained him immediately on the parole violation charge. McGinnis, 452 F.2d at 834. The parole board denied Pollack credit for the balance of the time he had served (approximately one year) under the terms of the relevant state statute. Id. at 835. Pollack petitioned for a writ of habeas corpus. The Second Circuit concluded that to deny Pollack the credit he requested would violate principles of equal protection. Id. at 836.
Similarly, in Floyd v. State, 540 P.2d 1195, 1196-97 (Okla.Crim.App.1975), Floyd was arrested and convicted for a new offense while he was on parole. The new conviction was vacated on appeal, and the state subsequently dismissed the charges. However, the state had revoked Floyd’s parole based upon the new charges. Floyd sought to receive credit toward his parole revocation for the time he served on the vacated conviction. 540 P.2d at 1196, 1198. The Oklahoma Court of Criminal Appeals agreed that Floyd was entitled to this credit, finding Floyd’s situation analogous to that of a prisoner who is serving consecutive sentences who has one of those sentences vacated; in the analogous case, the prisoner is entitled to have the time served on the invalid sentence credited against his other consecutive sentences. Id. at 1198. The court stated:
Common sense and fundamental fairness require that under such circumstances the state should not ignore the period of imprisonment under the invalid sentence when an appropriate remedy is so readily available.
Id. at 1197 (quoting Miller v. Cox, 443 F.2d 1019, 1021 (4th Cir.1971)). See also Meadows v. Blackwell, 433 F.2d 1298 (5th Cir. 1970); Blake v. New York State Department of Correction, 70 Misc.2d 671, 334 N.Y.S.2d 467 (1972).
Finally, we believe that our decision will prevent a prisoner from being unfairly and arbitrarily deprived of credit because of the failure to institute revocation proceedings in a prompt and timely manner. Our holding will prevent the prisoner who is acquitted but whose parole or probation is nevertheless revoked based on that same criminal conduct from being denied credit for pretrial incarceration if he was unable to make bail. As the Minnesota Supreme Court recently stated in a similar case:
[I]f credit is not allowed in this case, the effect will be the same as if the prosecutor acted in a deliberate attempt to manipulate unfairly the charging process to defendant’s disadvantage. Further, the fact that defendant [may be] indigent and, therefore, unable to post bail on the ... [second] charge is a factor affecting our decision. There may be certain inequities in the award of jail credit which we cannot correct. This is one case in which the inequity can be corrected.
State v. Folley, 438 N.W.2d 372, 374 (Minn.1989).
Accordingly, Walters is entitled to have thirteen days credited to the sentence which was imposed when his probation was revoked, and the order of the superior court is REVERSED.
. If the parolee or probationer is acquitted of the crime, he is entitled to credit against the sentence which is imposed for the violation of probation or parole. Smith v. Pennsylvania Board of Probation and Parole, 131 Pa.Cmwlth. 360, 570 A.2d 597, 599 (1990). If the parolee or probationer is convicted, he may be entitled to credit only against his new sentence. Id.; see State v. Ryan, 399 N.W.2d 151 (Minn.App.1987). However, if the new sentence is concurrent with the parole or probation revocation sentence, he would be entitled to credit against both sentences. State v. Doyle, 386 N.W.2d 352 (Minn.1986).