
24 So.3d 566 (2009)
Warren STANG, Petitioner,
v.
STATE of Florida, Respondent.
No. 2D08-3536.
District Court of Appeal of Florida, Second District.
July 31, 2009.
*567 Warren Stang, pro se.
Bill McCollum, Attorney General, Tallahassee, and Sara Macks, Assistant Attorney General, Tampa, for Respondent.
PER CURIAM.
Warren Stang seeks a writ of certiorari directed to the Circuit Court for the Tenth Judicial Circuit, which denied his petition for writ of habeas corpus. Stang contends that he is being illegally detained in the Tenth Judicial Circuit under a sentencing order that is void. Because the attachments to Stang's petition show that the sentencing order is void, we treat Stang's petition as a petition for writ of habeas corpus, grant it, and order his release.
Stang initially pleaded guilty in January 2000 to twenty-four various white-collar offenses that occurred between 1991 and 1994. He was sentenced to five years in prison for fifteen of the counts, to run concurrently and with credit for time served, followed by three years of probation for the remaining nine counts, also to run concurrently. After serving his time in prison, Stang was released to probation, which he subsequently violated. The sentencing order on the violation of probation, dated March 30, 2005, imposed a combination of concurrent and consecutive sentences on the pending nine counts that totaled twenty-seven years. However, the order also granted Stang 1915 days' credit for time served and indicated that the credit was to be applied against each count. The practical effect of this sentencing *568 order was that Stang would serve about two months in prison and then be released with no further supervision.
On April 21, 2005, Stang appealed the revocation of his probation to the Fourth District Court of Appeal. While this direct appeal was pending, Stang was transferred to the custody of the Department of Corrections. When the Department saw the March 30, 2005, sentencing order, it was "confused." Thus, on June 6, 2005, with no notice to Stang, his counsel, or the State, the Department faxed a letter to "Ana" at the Palm Beach County Clerk of Court. The fax attached the two-page sentencing order from March 30, 2005, and noted that page two of the sentencing order allowed Stang credit for "1,915 days `plus' the original county jail time and time served in the department's custody from [sic] counts 1 thru 3, 8, 30, 33, 34, 37, 39, 42, 51, 56, 60, 62 and 64, in accordance with Tripp v. State." The fax also noted that awarding this credit "would result in a potential immediate release." Therefore, the Department requested that the court "clarify" Stang's sentence within three working days.
Apparently in response to this letter, on June 7, 2005, the trial court entered an "amended" sentence that gave Stang a total of 1915 days' credit against his entire sentence. This amendment meant that Stang would serve approximately twenty-two years in prison, rather than approximately two months. Neither Stang nor his counsel were given notice of this "resentencing," and the "amended" sentence was not provided to Stang, his counsel, or the State. This "amended" sentence was entered sixty-nine days after Stang was sentenced for the violation of probation and while Stang's direct appeal of that sentence was pending.
Stang first learned of the existence of this "amended" sentencing order when he questioned the Department about his release date. The Department told Stang that he had been awarded 1915 days' credit against his total sentence, not each count, and it provided him with the "amended" sentence. When Stang attempted to address the issue of which sentence should be enforcedthe original or the "amended"through the prison grievance system, he was told that the Department was required to enforce the "amended" sentence and that it had no authority to disregard that sentence.
Stang also attempted to address the enforceability of the "amended" sentence through the court system. In a motion filed pursuant to Florida Rule of Criminal Procedure 3.850, Stang argued that the "jail time served" award in the "amended" sentence was incorrect and contrary to the sentence imposed when he entered his admission to the violation of his probation. See Stang v. State, 976 So.2d 656 (Fla. 4th DCA 2008). After the trial court denied this claim as untimely, Stang appealed, and the Fourth District reversed and remanded for reconsideration on the merits. Id. On remand, the postconviction court ordered the State to respond. The State did so by arguing that Stang was not entitled to the "windfall" of having his time served applied to each count. From the record before this court, it does not appear that the State addressed the issue of whether the "amended" sentence was legally entered or whether it comported with the sentence actually imposed at the violation of probation hearing. After "adopting" the State's response, the postconviction court denied Stang's rule 3.850 motion on April 18, 2008.
Stang did not appeal the denial of this postconviction motion. Instead, on June 26, 2008, he filed a petition for writ of habeas corpus with the Tenth Judicial Circuit arguing that the "amended" sentence *569 was void because it was rendered during the pendency of his direct appeal. He also argued that entry of the "amended" sentence violated his due process rights because neither he nor his counsel were given notice of the court's intent to amend his sentence nor was he given the opportunity to be present when his sentence was amended. Finally, he argued that because his original sentence was not illegal and because the sixty-day period for modifying a sentence under rule 3.800(c) had expired, the trial court had no jurisdiction to "correct" any error in his sentence on the sixty-ninth day. Stang asserted that the initial legally imposed sentence had long since expired and that he was entitled to immediate release. The postconviction court denied Stang's habeas petition, finding that his claims had been "addressed appropriately at the administrative level." Stang then sought review of that ruling by seeking a writ of certiorari in this court.
As an initial matter, we treat Stang's petition for writ of certiorari as a petition for writ of habeas corpus because Stang is seeking his immediate release from custody. Florida Rule of Appellate Procedure 9.040(c) provides that "[i]f a party seeks an improper remedy, the cause shall be treated as if the proper remedy had been sought." Because Stang is seeking his immediate release from prison based on an allegedly void sentencing order, his petition for writ of certiorari should be treated as a petition for writ of habeas corpus.
Turning to the merits, we note that this court's jurisdiction to consider Stang's habeas petition is quite limited. While Stang was convicted and sentenced in Palm Beach County, a county not within the territorial jurisdiction of this court, this court nevertheless has jurisdiction to review the sentencing order because Stang is currently assigned to the Hardee Correctional Institution, which is within the territorial jurisdiction of this court. See Alachua Reg'l Juvenile Det. Ctr. v. T.O., 684 So.2d 814, 816 (Fla.1996). In such a case, "the scope of the reviewing court's inquiry is limited to whether the court that entered the [detention] order was without jurisdiction to do so or whether the order is void or illegal." Id.; see also Murray v. Regier, 872 So.2d 217, 221 (Fla.2002); Pressly v. Tadlock, 968 So.2d 1057, 1058 (Fla. 2d DCA 2007). The crux of the inquiry is whether the order is void or patently illegal, and "[t]he reviewing court may not discharge the detainee if the detention order is merely defective, irregular, or insufficient in form or substance." T.O., 684 So.2d at 816. As a practical matter, "[i]f the challenged detention order [is] determined to be in violation of the petitioner's constitutional guarantee of due process, then the order would clearly be `illegal' and not merely defective, irregular, or insufficient in form or substance." Murray, 872 So.2d at 222.
Here, our review of the record reveals that the detention order under which Stang is being held is void and illegal for several reasons. First, the trial court had no jurisdiction to "amend" Stang's sentence during the pendency of his direct appeal in the absence of a proper motion filed pursuant to Florida Rule of Criminal Procedure 3.800(b)(2). Florida Rule of Appellate Procedure 9.600(d) provides that a trial court retains jurisdiction during the pendency of an appeal in a criminal case to consider only motions filed pursuant to rule 3.800(b)(2) and motions addressed to post-trial release pursuant to rule 9.140(h). Cf. Brown v. State, 744 So.2d 1209, 1209 (Fla. 2d DCA 1999) (noting that the trial court's jurisdiction while an appeal is pending is limited to that provided by rule 9.600(d)).
*570 Here, Stang's sentence was not "amended" pursuant to any motion filed under rule 3.800(b)(2). Clearly Stang did not file such a motion, and the State could not have properly filed such a motion since rule 3.800(b) permits the State to seek relief "only if the correction of the sentencing error would benefit the defendant or. . . correct a scrivener's error." Nothing in the record indicates that the error in question was simply a scrivener's error, nor has the State ever asserted so in any of its filings with the postconviction court, the Fourth District, or in this appeal. Accordingly, pursuant to rule 9.600(d), the trial court was without jurisdiction to enter the "amended" sentence, and the "amended" sentence is therefore void and unenforceable.
Second, the "amended" sentence was entered in violation of Stang's due process rights. A defendant has a due process right to be present at any sentencing or resentencing hearing at which judicial discretion will be exercised. See, e.g., Griffin v. State, 517 So.2d 669, 670 (Fla. 1987); Mullins v. State, 997 So.2d 443, 445 (Fla. 3d DCA 2008). A defendant also has the right to notice of the sentencing hearing and notice that any new sentence is appealable. Cf. Butler v. State, 973 So.2d 677, 678 (Fla. 2d DCA 2008) (noting that a defendant has a due process right to be represented by counsel at any resentencing and to be informed of his right to appeal the new sentence); Fuston v. State, 838 So.2d 1205, 1207 (Fla. 2d DCA 2003) (questioning the validity of an amended sentence as violative of due process when the defendant was not advised that the amended sentence was appealable); Canete v. Fla. Dep't of Corr., 967 So.2d 412, 416 n. 4 (Fla. 1st DCA 2007) (expressing serious due process concerns about a sentence imposed outside the defendant's presence, without notice, and without entry of an appealable sentencing order). Here, the record clearly shows that the trial court adversely modified Stang's sentence outside of his presence, without notice, and without providing either Stang or his counsel with the "amended" sentence so that an appeal could be taken. These blatant due process violations, apparent from the face of the record, render the "amended" sentence illegal. See Murray, 872 So.2d at 222.
Third, the "amended" sentence violated Stang's double jeopardy rights. This court and others have repeatedly held that a trial court may not rescind jail credit that was previously awarded, even if the initial award was improper, because such an action violates double jeopardy. See, e.g., Lebron v. State, 870 So.2d 165, 165 (Fla. 2d DCA 2004); Linton v. State, 702 So.2d 236, 236-37 (Fla. 2d DCA 1997); Wheeler v. State, 880 So.2d 1260, 1261 (Fla. 1st DCA 2004); but see Gallinat v. State, 941 So.2d 1237 (Fla. 5th DCA 2006) (finding no double jeopardy violation if the trial court simply corrects an award of jail credit that is clearly incorrect based on the face of the record). Here, as the Department's faxed letter confirms, the original sentencing documents awarded Stang 1915 days' credit against each of his sentences. The State neither appealed this award nor filed a motion to modify pursuant to rule 3.800(c). Accordingly, the trial court's "taking back" of Stang's previously awarded jail credit was a violation of his double jeopardy rights that renders his "amended" sentence illegal.
Because the "amended" sentencing order under which the Department is holding Stang is void and illegal, it is unenforceable. Under these circumstances, Stang can be legally held pursuant only to the original sentence imposed on March 30, 2005not the June 7, 2005, "amended" sentence. Since the sentence imposed on *571 March 30, 2005, expired years ago, Stang is entitled to immediate release.
Petition for writ of habeas corpus granted.
NORTHCUTT and VILLANTI, JJ., Concur.
WHATLEY, J., Concurs in result only.
