
68 So.3d 259 (2010)
William K. BISHOP, Petitioner,
v.
George SHELDON, Secretary, Department of Children and Family Services, Respondent.
No. 2D09-1347.
District Court of Appeal of Florida, Second District.
December 1, 2010.
James S. Purdy, Public Defender, and Meghan Ann Collins, Assistant Public Defender, Daytona Beach, for Petitioner.
Bill McCollum, Attorney General, Tallahassee, and Douglas T. Squire, Assistant Attorney General, Tampa for Respondent.
SILBERMAN, Judge.
William Bishop, a committed person under the Involuntary Civil Commitment of *260 Sexually Violent Predators Act[1] (the Act), filed a petition for writ of habeas corpus seeking his immediate release from the Florida Civil Commitment Center. He asserts that the circuit court did not have jurisdiction to adjudicate the commitment petition filed under the Act because he was not in lawful custody at the time that proceedings under the Act were commenced. We conclude that factual issues preclude us from determining whether Bishop was in lawful custody when the State commenced proceedings under the Act, and we transfer the petition to the circuit court to conduct an evidentiary hearing to resolve this issue.
On February 16, 1998, Bishop was sentenced under the 1995 sentencing guidelines to fifty-four months in prison for the offense of committing a lewd act upon a child. In 2000 he filed a postconviction motion claiming that he was entitled to be resentenced under the 1994 sentencing guidelines pursuant to Heggs v. State, 759 So.2d 620 (Fla.2000), in which the supreme court struck the 1995 sentencing guidelines as unconstitutional. The postconviction court granted relief on Bishop's claim, and on September 7, 2000, the court resentenced Bishop to 31.75 months in prison followed by six years' probation.[2] The court granted Bishop credit for 143 days' time served and imposed the sentence nunc pro tunc to February 16, 1998.
On the date of resentencing, the State filed its petition to have Bishop committed under the Act. Bishop later filed a motion to dismiss and an amended motion to dismiss, arguing that he was not in lawful custody when the State filed its commitment petition. He asserted that he had fully served his corrected sentence on either January 5, 2000, or May 19, 2000, depending upon whether he was awarded the maximum amount of gain time[3] or required to serve one hundred percent of his corrected sentence. The circuit court denied Bishop's amended motion to dismiss and proceeded with the commitment proceeding, ultimately entering a commitment order. Bishop appealed the commitment order to the Fifth District Court of Appeal, which affirmed. See Bishop v. State, 944 So.2d 374 (Fla. 5th DCA 2006) (table decision).
In the habeas petition, Bishop argues that he is entitled to relief based on Larimore v. State, 2 So.3d 101 (Fla.2008), in which the supreme court recently held that the Act does not apply to persons who are not in lawful custody when commitment proceedings are initiated. Bishop renews his contention that because of his resentencing, he was not in lawful custody when the State commenced commitment proceedings. He submits that he had fully served his sentence and should have been released from prison before the State filed its commitment petition.
Preliminarily, we note that the legality of Bishop's continued detention under the Act is cognizable in a petition for writ of habeas corpus. See Murray v. Regier, 872 So.2d 217, 223 (Fla.2002) (determining that the appellate court should have considered the merits of Murray's *261 petition for writ of habeas corpus, which asserted that the civil commitment order was illegal because it violated his constitutional due process rights). On the merits, we conclude that Bishop may be entitled to relief under Larimore if his sentence had indeed expired before the State initiated commitment proceedings under the Act.
Larimore involved a guilty plea to lewd and lascivious acts on a child in two separate cases in 1991. 2 So.3d at 104. Larimore was sentenced to fifteen years in prison in one case followed by five years of probation in the second case. He was released from prison in 1998 due to a gain time award, and he began serving his probation. The court revoked Larimore's probation in February 2000 and sentenced him to five years in prison.
In August 2002, the First District Court of Appeal determined that Larimore was entitled, pursuant to Tripp v. State, 622 So.2d 941 (Fla.1993), to credit against the five-year prison sentence for the time served on the fifteen-year sentence imposed in the first case, including actual prison time and gain time. Larimore, 2 So.3d at 104. The award of credit would have effectively erased the five-year sentence imposed for the violation of probation, but the Department of Corrections (DOC) forfeited 2830 days of gain time Larimore had earned on his fifteen-year prison sentence. Id.
In November 2004, while Larimore was in prison, the State filed a petition for involuntary civil commitment pursuant to the Act. Less than one month later, the First District held that Larimore was entitled to immediate release from custody because the DOC's forfeiture of his gain time was unauthorized. Id. (citing Larimore v. Fla. Dep't of Corr., 910 So.2d 847 (Fla. 1st DCA 2004)). Larimore then filed a motion to dismiss the commitment petition on the ground that he was not in lawful custody on the effective date of the Act. After the circuit court denied his motion, he filed a petition for writ of prohibition in the First District to prevent further proceedings against him under the Act. The First District denied the petition. 2 So.3d at 104 (citing Larimore v. State, 917 So.2d 354, 355 (Fla. 1st DCA 2005)).
On review of the denial of Larimore's petition for writ of prohibition, the supreme court held that Larimore was entitled to release because he "was not in legal custody when initial steps were taken to initiate civil commitment proceedings against him." Id. at 117. The court noted that it had previously construed the term "custody" to mean "lawful custody" in State v. Atkinson, 831 So.2d 172, 174 (Fla. 2002), in which it held that the Act was not applicable to individuals who were not in lawful custody on its effective date. Larimore, 2 So.3d at 115. The court explained that
interpreting the Jimmy Ryce Act as not requiring lawful custody for individuals who had been incarcerated at some point after the effective date of the Act but are not in lawful custody when commitment proceedings are initiated would be contrary not only to the overall intent of the Act but "would be contrary to the basic tenets of fairness and due process."
Id. (quoting Atkinson, 831 So.2d at 174).
Under Larimore and Atkinson, Bishop could not be committed pursuant to the Act if he was not in lawful custody when the State initiated commitment proceedings. However, this does not necessarily mean that Bishop is entitled to be released from the Florida Civil Commitment Center. Commitment proceedings are initiated by either giving "written notice" to the multidisciplinary team and the state attorney as provided in section 394.913(1), Florida Statutes (1999), or by transferring *262 the person to the custody of the Department of Children and Family Services (DCF) when the person is immediately released for some reason as provided in section 394.9135(1). While Bishop argues that the State initiated commitment proceedings in this case by filing the commitment petition, it appears that the State actually provided an earlier written notice to the multidisciplinary team and state attorney. The State's commitment petition and Bishop's motion and amended motions to dismiss refer to evaluations by members of the multidisciplinary team that were performed prior to the State's filing of its commitment petition. However, none of the documents that have been provided to this court reflect the exact date when written notice was given to the multidisciplinary team and the state attorney pursuant to section 394.913(1).
Thus, even if Bishop was not in lawful custody at the time the commitment petition was filed, the question remains whether he was in lawful custody when the State provided written notice to the multidisciplinary team pursuant to section 394.913(1). Further, Bishop has raised an issue as to alternative dates by which he should have been released from prison based on whether he was awarded gain time. We are unable to make factual determinations regarding all of these dates; thus, we must transfer Bishop's habeas petition to the circuit court for an evidentiary hearing. See Madison v. State, 27 So.3d 61, 63 (Fla. 1st DCA 2009) (noting in a direct appeal from a commitment order that the circuit court had subject matter jurisdiction to adjudicate the commitment petition only if Madison was in lawful custody when the commitment process was initiated and remanding for an evidentiary hearing to resolve the lawful custody issue).
In its response to Bishop's habeas petition, the State argues that Bishop's reliance on Larimore and Atkinson is misplaced. The State relies on a footnote in Larimore in which the court stated as follows:
In this case, Larimore's entire resentencing was unlawful. Thus, we do not reach the question of whether section 394.9135, Florida Statutes, would allow the State to take steps to initiate a commitment proceeding against a person who while in lawful custody obtains an order for immediate release for any reason. That issue is not before us.
2 So.3d at 117 n. 8. The State contends that Larimore does not apply because Bishop was in lawful custody when he was resentenced pursuant to Heggs. The State submits that Atkinson does not apply because that case involved the question of lawful custody on the date the Act became effective. Because the resentencing here would have resulted in Bishop's immediate release, the State contends that it properly filed its commitment petition on that same date and was entitled to proceed against Bishop pursuant to section 394.9135.
In the present case, Bishop, like Larimore, is claiming that he was not in lawful custody when commitment proceedings were commenced. While Larimore and Bishop were not resentenced for the same reason, Bishop was resentenced for the same reason as Atkinson, who had also been resentenced under the 1994 sentencing guidelines under Heggs. See Atkinson, 831 So.2d at 173. We conclude that if the effect of the Heggs resentencing in Atkinson was that Atkinson was not in lawful custody at the time the Act was enacted, then the effect of the Heggs resentencing in this case was that Bishop was not in lawful custody at the time the commitment petition was filed. Because Larimore requires that a person be in lawful custody when commitment proceedings *263 are commenced, the circuit court may not have had jurisdiction to adjudicate the commitment petition.
In conclusion, an evidentiary hearing is necessary to determine whether Bishop was, in fact, in lawful custody when the State commenced proceedings under the Act. Thus, upon issuance of the mandate in this case, the habeas petition shall be transferred to the Circuit Court for the Twelfth Judicial Circuit[4] in DeSoto County to make a factual determination regarding Bishop's custodial status. The circuit court shall determine whether, with the award of gain time,[5] commitment proceedings were commenced prior to the date of the expiration of Bishop's sentence following the Heggs resentencing. If commitment proceedings were not commenced prior to that date, the court should grant Bishop's petition and release him from the Florida Civil Commitment Center.
Petition transferred.
CRENSHAW, J., Concurs.
ALTENBERND, J., Dissents with opinion.
ALTENBERND, Judge, Dissenting.
Although I concurred in this case on initial release, for reasons more fully explained in my special opinion in Phillips v. State, ___ So.3d ___, 2010 WL 4861458 (Fla. 2d DCA 2010), I now dissent. This is another case in which I appreciate the court's effort to remain obedient to the supreme court's precedent in Larimore and Atkinson. Nevertheless, Mr. Bishop should not be allowed to deprive the Department of Children and Family Services of jurisdiction over him by his own decision to delay a postconviction motion so that, on recalculation, his sentence expired before the unpreserved error was corrected.
NOTES
[1]  The Involuntary Civil Commitment of Sexually Violent Predators Act, section 394.910.931, Florida Statutes (1999), is also known as the Jimmy Ryce Act. It provides for the involuntary civil commitment of persons found to be sexually violent predators upon their release from prison or other confinement.
[2]  Contrary to the dissent's suggestion, there is no indication Bishop delayed filing his postconviction motion challenging his illegal sentence.
[3]  See § 944.275(4)(b)(3), Fla. Stat. (1999) (providing that no gain time award may result in a prisoner's serving less than eighty-five percent of the sentence imposed).
[4]  Although Bishop's criminal and commitment proceedings took place in the Circuit Court for the Ninth Judicial Circuit, he is presently committed within the territorial jurisdiction of this court and the Circuit Court for the Twelfth Judicial Circuit. Thus, his challenge to the legality of his detention is properly considered within the territorial jurisdiction where he is detained. See Stovall v. Cooper, 860 So.2d 5, 8 (Fla. 2d DCA 2003); Morris v. State, 978 So.2d 259, 261 (Fla. 5th DCA 2008).
[5]  We note that in Atkinson the supreme court concluded that the corrected sentence under Heggs, imposed nunc pro tunc, would have expired prior to the effective date of the Act "even without the award of any gain time." 831 So.2d at 173. Thus, Atkinson did not address the effect of gain time in determining whether a person was in lawful custody at the time commitment proceedings were commenced. However, the First District in Madison remanded to the circuit court to consider gain time or other credits in making a factual determination of Madison's custodial status. 27 So.3d at 63. In the present case, the circuit court shall consider the application of basic gain time required by the statutes in effect at the time of the commission of Bishop's offense to the nunc pro tunc 31.75 months' prison sentence in determining his lawful custodial status. It shall also consider incentive gain time, or any other such credits actually awarded by the DOC until the commencement of commitment proceedings.
