
878 So.2d 438 (2004)
Martin DRYMON, Petitioner,
v.
STATE of Florida, Respondent.
No. 1D03-4053.
District Court of Appeal of Florida, First District.
July 14, 2004.
Martin Drymon, pro se, petitioner.
Rosa Carson, Acting General Counsel, and Judy Bone, Assistant General Counsel, Department of Corrections, Tallahassee, for respondent.
PER CURIAM.
Petitioner seeks a writ of certiorari to review an order from the circuit court which denied his petition for writ of mandamus. We grant the petition for writ of certiorari and direct the circuit court to issue the writ of mandamus.
On December 11, 1995, petitioner was sentenced to 15 years for lewd or lascivious *439 act in case # 87-2759. After pleading nolo contendere, petitioner was also sentenced as a habitual offender to a concurrent term of 20 years, followed by 2 years of probation for sexual battery in case # 94-3290. Petitioner subsequently filed a motion to withdraw his plea in case # 94-3290, contending that his counsel misadvised him that he qualified as a habitual offender. The trial court ultimately determined that petitioner did not qualify as a habitual offender. Therefore, on November 20, 1997, the court resentenced petitioner to a split sentence of 150 months in prison followed by 30 months probation, to be served consecutively with case # 87-2759. The trial court ordered that petitioner be allowed credit for all time served on this count prior to resentencing.
The Department of Corrections recalculated petitioner's release date. Because the sentences were now consecutive, the Department awarded basic and incentive gain time in case # 87-2759, which was earned from the December 11, 1995, sentencing date, to arrive at an ending sentence date of February 28, 2001. After resentencing in case # 94-3290, the Department only awarded petitioner incentive gain-time starting on February 28, 2001, when the consecutive sentence began. The Department applied 710 days as credit for prison time served in case # 7b 94-3290 between the date of the original sentence and the date of resentencing but did not include any incentive gain time petitioner earned while the sentences were concurrent.
After exhausting his administrative remedies, petitioner filed a petition for writ of mandamus in the circuit court. He argued that the Department's recalculation of his release date effectively forfeited all his gain time credits awarded from December 11, 1995, to November 20, 1997, in case # 94-3290. In response, respondent contended that petitioner had received benefit of the gain time earned during the serving of the concurrent sentences because the sentence in case # 87-2759 terminated early.
The circuit court denied the petition for writ of mandamus. The court found that the Department had properly applied the amount of jail credit, previous prison time served, and gain time to the sentences imposed in the two cases. The court stated that petitioner received the collateral benefit of the incentive gain time earned when the sentences were concurrent by virtue of an earlier expiration date of the sentence in case # 87-2759.
The circuit court departed from the essential requirements of the law in denying the petition for writ of mandamus. See Sheley v. Florida Parole Comm'n, 703 So.2d 1202 (Fla. 1st DCA 1997). In its order denying the petition, the circuit court states that petitioner was not eligible to receive an additional award of incentive gain time for a period when he was not serving the sentence imposed in case # 94-3290. However, petitioner did serve 710 days under the original concurrent sentences and earned 412 days of gain time on both sentences during that period. Upon resentencing, the trial court specifically awarded the 710 days of credit for time served. As the trial court awarded petitioner 710 days credit for time served in prison prior to resentencing, the credit should include any unforfeited gain time accrued prior to resentencing. Cf. Davidson v. State, 780 So.2d 984, 985 (Fla. 1st DCA 2001) (stating that defendants "who have been resentenced through no fault of their own are entitled upon resentencing to credit for all actual time served and gain time earned during their initial prison term"); Jones v. State, 633 So.2d 482 (Fla. 1st DCA 1994) (stating that, where a defendant is resentenced following violation *440 of probation, credit for time served does not include forfeited gain time); see also Tillman v. State, 693 So.2d 626 (Fla. 2d DCA 1997); § 948.06(6), Fla. Stat. (1997). Respondent has not shown that the gain time credit was forfeited for any reason. Therefore, petitioner is entitled to the 412 days of gain time earned between December 11, 1995, and November 20, 1997, in case # 94-3290.
This case is similar to the facts in Walker v. State, 619 So.2d 518 (Fla. 1st DCA 1993). Walker received concurrent terms of imprisonment for two counts of lewd and lascivious acts. After successfully moving to correct an illegal sentence, Walker was resentenced to consecutive terms of incarceration. Id. at 518. The written judgment reflected credit for jail time and prison time already served but did not mention gain time. Walker then filed a direct appeal from his resentence seeking credit for gain time accumulated during his concurrent terms of incarceration. Id. at 519. This Court determined that the trial court had no authority to rule on the issue as it was a function of the Department of Correction. Id. In dicta, however, this Court stated that "Walker should be given credit for gain time he had earned up to the resentencing herein." Id.
Accordingly, we grant the petition for writ of certiorari and quash the order denying the petition for writ of mandamus. The circuit court is directed to enter an order compelling respondent to credit petitioner in case # 94-3290 with 412 days of gain time earned between December 11, 1995, and November 20, 1997.
PETITION GRANTED.
WOLF, C.J., KAHN and LEWIS, JJ., concur.
