
985 So.2d 21 (2008)
Julian WATTS, Appellant,
v.
STATE of Florida, Appellee.
No. 2D07-4225.
District Court of Appeal of Florida, Second District.
May 21, 2008.
Rehearing Denied July 11, 2008.
Julian Watts, pro se.
Bill McCollum, Attorney General, Tallahassee, and Deborah Fraim Hogge, Assistant Attorney General, Tampa, for Appellee.
VILLANTI, Judge.
Julian Watts appeals the dismissal of his petition for writ of habeas corpus filed in the Circuit Court of the Tenth Judicial Circuit in and for Polk County. We reverse and remand for further proceedings.
*22 The record on appeal is very limited. Watts' petition challenged the legality of his sentence for violating probation. According to his petition, he was sentenced in 1991[1] to twenty-seven years in prison, followed by ten years' probation. On March 28, 2003, after allegedly serving fifteen years of his sentence, Watts was released to serve ten years' probation. Watts claims that he violated probation on May 3, 2006, and in October 2006, he was resentenced to thirty-five years in prison with credit for time served. His petition for habeas corpus challenged the thirty-five-year sentence, alleging that it was an illegal sentence. The circuit court summarily dismissed the petition holding:
A Writ of Habeas Corpus is not the proper vehicle for obtaining additional appeals of issues which were raised or should have been raised on direct appeal, which were waived at trial, or which could have, should have, or have already been raised in postconviction proceedings. . . . [Watts] may file a Rule 3.800 or 3.850 motion for postconviction relief, provided he is not procedurally barred from doing so.
(Citations omitted.) While the circuit court was correct in concluding that a habeas corpus petition was an improper vehicle for challenging Watts' sentence, his petition should have been treated as a motion for postconviction relief.
In Valdez-Garcia v. State, 965 So.2d 318, 322 (Fla. 2d DCA 2007), this court noted that a writ of habeas corpus "provide[s] a constitutional remedy to assure the right to seek one's freedom from detention whenever the law does not otherwise provide an adequate mechanism to obtain relief from illegal detention." (Emphasis added.) In this case, Watts' petition was not attacking his detention but rather the sentence imposed. It does not appear that Watts filed any postconviction motions challenging his sentence, and two years have not elapsed since imposition of the allegedly illegal sentence. Therefore, Watts could have and should have filed a motion for postconviction relief attacking the legality of his sentence. Id. at 319 ("When an imprisoned defendant wishes to collaterally attack his judgment or sentence in the circuit court of the county where he was convicted, the proper procedure is to file a motion for postconviction relief under rule 3.850.") Consequently, habeas relief was not appropriate in Watts' case. See Bixler v. State, 971 So.2d 934, 935 (Fla. 2d DCA 2007) (holding that habeas is not appropriate where rule 3.850 provides an adequate mechanism to address issues raised by the defendant).
However, the circuit court should not have dismissed the petition. It appears that Watts' October 2006 conviction and sentence occurred in Polk County, where Watts filed his petition for habeas corpus. Therefore, the circuit court should have treated Watts' petition as a motion for postconviction relief, despite its improper title.[2]See Bixler, 971 So.2d at 935 (holding that circuit court should not have dismissed habeas petition and should have instead treated it as a motion for post-conviction relief); Valdez-Garcia, 965 So.2d at 323 (noting that where the defendant filed petition for habeas corpus in the circuit court in which he was convicted, the court should have treated the petition as a motion seeking postconviction relief).
*23 Accordingly, we reverse the order dismissing the petition and remand with directions to the circuit court to consider the petition as a motion for postconviction relief.
Reversed and remanded for further proceedings.
FULMER and STRINGER, JJ., Concur.
NOTES
[1]  Watts' petition simply alleged that he was "found . . . guilty of murder." The record on appeal does not contain a copy of Watts' judgment and sentence.
[2]  Watts' probation was revoked in October 2006. Therefore, it appears that he is within the two-year window ordinarily provided to seek postconviction relief under Florida Rule of Criminal Procedure 3.850(b).
