
340 S.W.3d 259 (2011)
David A. BURLEW, Appellant,
v.
MISSOURI DEPARTMENT OF CORRECTIONS, Respondent.
No. WD 72135.
Missouri Court of Appeals, Western District.
April 5, 2011.
Edward S. Thompson, for appellant.
Shaun J. Mackelprang, Chris Koster, Stephen D. Hawke, Jefferson City, MO, for respondent.
Before: VICTOR C. HOWARD, P.J., and THOMAS H. NEWTON and ALOK AHUJA, JJ.
*260 ALOK AHUJA, Judge.
David Burlew appeals the Cole County Circuit Court's dismissal of his petition seeking declaratory relief against the Department of Corrections. Burlew's petition alleges that he is entitled to time-served credit against a prison sentence he is currently serving, which the Department has refused to grant him. Because we conclude that Burlew has pleaded a claim which would entitle him to relief, we reverse.

Factual Background
According to the petition,[1] on July 27, 2007, Burlew entered guilty pleas for felony driving while intoxicated ("DWI"), and two separate violations of orders of protection. The circuit court sentenced Burlew on the same day to four years' imprisonment for the felony DWI, four years' imprisonment for the first order of protection violation (to run consecutively to the DWI sentence), and four years for the second order of protection violation (to "run concurrently with the sentence[s] in the first two cases"). It appears from the allegations of Burlew's petition that he was originally jailed in connection with these offenses on November 8, 2006.
Burlew subsequently sought post-conviction relief under Supreme Court Rule 24.035, asserting that the DWI charge had been improperly enhanced to a felony.[2] The circuit court agreed, and on October 20, 2008, vacated the judgment and sentence on the DWI charge. That same day, Burlew was sentenced to six months' imprisonment for misdemeanor DWI instead.
Burlew received credit towards the misdemeanor DWI sentence for time served on the vacated felony DWI; according to his petition, he satisfied his six-month misdemeanor DWI sentence on May 7, 2007. Even though Burlew contends that the misdemeanor DWI sentence was fully served as of May 7, 2007, the Department refused to credit Burlew for any time served on his consecutive order of protection sentence prior to October 20, 2008, the date on which the felony DWI conviction was actually vacated in response to Burlew's Rule 24.035 motion. This left 532 days (from May 7, 2007 through October 20, 2008) which were not credited to either of his consecutive sentences, as depicted below:
*261 
On August 24, 2009, Burlew filed a petition for declaratory judgment, arguing that he had unlawfully been denied time credit because he served 532 days on the vacated felony DWI conviction that the Department refused to credit to either of his two consecutive sentences. The Department moved to dismiss for failure to state a claim. On January 6, 2010, the circuit court granted the Department's motion, and dismissed Burlew's petition. The court explained:
Petitioner's theory is based on the assumption that he was sentenced to six months [for the DWI] originally. Petitioner was not. Reality differs from theory. Petitioner had received a four year sentence [for the vacated felony DWI], and he was serving that four year sentence until the date that the sentence was vacated, October 20, 2008. Petitioner's consecutive four year sentence for violation of an order of protection did not begin until that date, October 20, 2008.
The circuit court also held that Burlew was not entitled to credit under § 558.031.1(1), RSMo, because the time he served between May 7, 2007 and October 20, 2008 was not "related to" the order of protection offense.
Burlew appeals.

Standard of Review
In reviewing the court's dismissal of appellant's declaratory judgment action, we deem all facts pleaded to be true, liberally construe the petition's averments, and draw all reasonable and fair inferences therefrom. We review the allegations set forth in the petition in order to determine whether principles of substantive law are invoked, which, if proved, would entitle petitioner to declaratory relief. If so, then the petition is sufficient and cannot be dismissed for failure to state a claim. In other words, if the petition contains facts, not mere conclusions, supporting its allegations, and those facts demonstrate a justiciable controversy, then we will reverse the court's dismissal and remand the cause to the court for a determination of the parties' rights.
Sandy v. Schriro, 39 S.W.3d 853, 855 (Mo. App. W.D.2001) (citations omitted).

Analysis
Burlew asserts that his four-year consecutive sentence for violating a protection order should have begun running on May 7, 2007, the day on which he alleges that he completed serving the misdemeanor DWI sentence, and not on October 20, 2008, when the circuit court actually vacated the felony DWI. As a result, Burlew requests that the 532 days he served between those two dates be credited to the protection order sentence. We conclude that the allegations of Burlew's petition *262 state a claim upon which relief could be granted, and accordingly reverse.
The circuit court's judgment is based on its conclusion that Burlew "was serving th[e] four year sentence [on the felony DWI] until the date that the sentence was vacated, October 20, 2008," and that Burlew could not receive credit on his consecutive order of protection sentence until the felony DWI conviction was actually vacated by a court order. This conclusion is inconsistent with our decision in Calvin v. Missouri Department of Corrections, 277 S.W.3d 282 (Mo.App. W.D.2009).
In Calvin, an offender was sentenced to a five-year sentence on a 1996 charge of criminal nonsupport, and to a consecutive two-year sentence on a 1998 criminal nonsupport charge. This Court later vacated the 1998 conviction. Calvin addressed the effect of our vacation of the 1998 conviction on the time the offender was required to serve on the 1996 conviction.
In order to appreciate the similarity between the issues presented in this case and in Calvin, it is necessary to recount the context of that case in some detail. As Calvin explained:
Section 558.011.4(1)[, RSMo] provides that "[a] sentence of imprisonment for a term of years for felonies other than dangerous felonies . . . shall consist of a prison term and a conditional release term." (Emphasis added.) The department rule stated at the time:
An inmate with a consecutive sentence shall be held until the inmate completes the prison term of the consecutive sentence(s). The conditional release terms taken together shall constitute the time to be served on conditional release.
According to the department, these two provisions, taken together, mean that an inmate with consecutive sentences must first complete the prison term portion of both sentences (in consecutive order) before he begins serving the conditional release portion of the first sentence (to be followed by the conditional release portion of the second). . . .
. . . The department contends that after Calvin . . . finished serving the "prison term" portion of his 1996 five-year sentence on May 20, 2005[,] . . . [he] began serving the "prison term" portion of his two-year sentence in the 1998 case. Thus, the department says, the 556 days that he spent in prison from May 21, 2005, to November 28, 2006 (the date of our mandate vacating his 1998 sentence), could apply only to the "prison term" portion of his 1998 sentence. It could not be counted toward the "conditional release" portion of his 1996 five-year sentence, despite the fact that the 1998 sentence was vacated, according to the department. Under the department's theory, Calvin's sentence on the 1998 case remained valid until the date this court issued its mandate vacating the conviction and sentence. As a result, the department contends that after November 28, 2006, Calvin still had the 20-month "conditional release" portion of the five-year 1996 sentence yet to serve . . .
Id. at 285 (footnote and citation omitted).
As the quoted passage makes clear, although Calvin involved the vacation of the second of two consecutive sentences, the case nevertheless presented a situation functionally identical to the one we face here. In Calvin, the "prison term" of the "second" sentence (for the vacated 1998 criminal nonsupport conviction) was required to be served before the "conditional release term" of the "first" sentence (for *263 the 1996 criminal nonsupport conviction). As in this case, the question in Calvin was whether, after vacation of one conviction, a sentence which follows the vacated sentence "drops down," so that the defendant receives credit against the valid sentence for time which was ostensibly served on the vacated sentence. And, in Calvin, the Department made the same argument it makes here: that a vacated conviction and sentence "remained valid until the date" on which a court order vacating the conviction actually took effect.
Contrary to the circuit court's decision in this case, Calvin held that, where one conviction and sentence in a consecutive sequence is later vacated, the other sentences in the sequence should be recalculated to run as if the vacated sentence had never existed:
No doubt the department is correct that the 1998 conviction and sentence had prima facie validity before they were set aside. In that sense, they were voidable. However, common sense and reasonable justice would dictate that once the conviction and sentence were set aside, they must be treated, for maximum release date purposes, as having been void. Thus, a recalculation of the maximum release date in view of the vacation of the 1998 sentence was entirely appropriate. When the 1998 conviction and sentence in this case were vacated for lack of a factual basis, it was a declaration that the sentence was to be regarded as though it had never existed.
Id. at 288.[3]
Under our analysis in Calvin, the running of Burlew's four-year consecutive sentence for violating a protection order must be calculated "as though [the vacated felony DWI sentence] had never existed." Id. Thus, his order of protection sentence would begin running on the day Burlew completed serving the misdemeanor DWI sentence (which the petition alleges was on May 7, 2007), and not on October 20, 2008, when the circuit court actually vacated the felony DWI.
The State argues that, unlike in Calvin, the defects in Burlew's DWI conviction were "curable," as evidenced by the fact that he was convicted and sentenced for a misdemeanor DWI offense following vacation of his felony DWI conviction. The defects in Burlew's felony DWI conviction were apparently not "curable," however, as he was instead convicted of, and sentenced for, a misdemeanor. Further, the principle of Calvinthat a vacated sentence should be treated "as though it had never existed"is equally applicable where a lesser sentence is imposed in lieu of the vacated sentence, as where the offender is subject to no substitute sentence whatsoever. See Brown v. State, 291 Ga.App. 518, 662 S.E.2d 297, 299 (2008) (where sentence is vacated but offender is resentenced, any subsequent consecutive sentence begins to run when the substitute sentence terminates; citing Jackson v. *264 Jones, 254 Ga. 127, 327 S.E.2d 206, 207 (1985)).
The State also relies on our decision in Pettis v. Missouri Department of Corrections, 275 S.W.3d 313 (Mo.App. W.D.2008). But Pettis did not address the issue we face here. In that case, an offender was originally sentenced, for heroin possession in a correctional institution, to a sentence consecutive to an existing sentence of life imprisonment which the offender was serving. Id. at 316. The consecutive heroin possession sentence was later vacated, and a concurrent sentence imposed in its stead. Id. The offender argued that, under § 558.031.4, RSMo, his concurrent sentence should be treated as if it had been imposed as of the time of imposition of his original, consecutive sentence for the heroin possession offense. We rejected the offender's claims because § 558.031.4 only authorizes credit on the new sentence for "all time served under the vacated sentence" (emphasis added), and no time had actually been served under the vacated consecutive sentence when that sentence was vacated. Id. at 319. But § 558.031.4 is inapplicable here, since it only applies to a "new sentence imposed upon the offender" in lieu of a vacated sentence. Here, we are dealing with the effect of a vacated sentence on the running of a sentence for a separate offense.
The circuit court also relied on § 558.031.1, RSMo, in dismissing Burlew's claims. Section 558.031.1 provides in relevant part that an offender "shall receive credit toward the service of a sentence of imprisonment for all time in prison, jail or custody after the offense occurred and before the commencement of the sentence, when the time in custody was related to that offense." But § 558.031.1 has no application here, at least with respect to the time Burlew served subsequent to his conviction and sentencing on July 27, 2007. Burlew's claim is not that he is entitled to credit for time served "before the commencement of the sentence" on his order of protection violation; instead, Burlew argues that his order of protection sentence should be deemed to have commenced as soon as his sentence for the misdemeanor DWI concluded. The "related to" provision of § 558.031.1 is not relevant to determining the date of commencement of Burlew's order of protection sentence.
Burlew does not only seek credit for time that he served subsequent to his conviction and sentencing on July 27, 2007, howeverhe also seeks credit for certain pre-conviction time he spent in custody. The "related to" test of § 558.031.1 is relevant to Burlew's right to credit for any time he spent in custody prior to his conviction and sentence on July 27, 2007, since this time in custody necessarily occurred "before the commencement of the sentence" on the order of protection violation. The circumstances surrounding this pre-conviction custodial time (which according to the petition is the period between May 7 and July 27, 2007) will need to be developed on remand, including the causes of Burlew's arrest and incarceration, and whether he was subject to release on bail for the offenses for which he was being held. See generally Dykes v. Mo. Dep't of Corr., 325 S.W.3d 556, 559-61 (Mo.App. W.D.2010); Mikel v. McGuire, 264 S.W.3d 689, 692-93 (Mo.App. W.D.2008).

Conclusion
For the foregoing reasons, the judgment of the circuit court dismissing Burlew's petition for declaratory relief is reversed, and the case is remanded to the circuit court for further proceedings consistent *265 with this opinion.[4]
All concur.
NOTES
[1]  As explained below, because this case was dismissed for failure to state a claim we assume the facts alleged in Burlew's petition to be true.
[2]  According to Burlew's petition in this case, his post-conviction relief motion alleged that the DWI charge had been enhanced to a felony based on a prior prosecution in municipal court for which he received a suspended imposition of sentence, and that this disposition could not be used for enhancement purposes under Turner v. State, 245 S.W.3d 826 (Mo. banc 2008). Burlew's post-conviction relief motion also alleged that he had not committed an intoxication-related traffic offense within the five years preceding his current offense.
[3]  Calvin expressed its agreement with the circuit court's conclusion "that the department's theory, under which `an inmate can be required to serve time on a vacated sentence (and in effect serve time in state prison that counts toward nothing), deprives the inmate of his rights to due process of law, his right to be free from cruel and unusual punishment, and his right to be free from double jeopardy[.]'" Id. at 287 (quoting circuit court's judgment).

The rule announced and applied in Calvin is consistent with decisions in other States. See, e.g., Butcher v. State, 196 Md.App. 477, 10 A.3d 201, 208 (2010) ("[W]e find the majority rule to be that, when one of a series of consecutive sentences is nullified, the next valid sentence begins on the date set for the commencement of the invalidated sentence.").
[4]  In remanding this case we are mindful that, on Burlew's allegations, his consecutive order of protection sentence would apparently conclude in May 2011.
