
28 So.3d 135 (2010)
Todd Matthew CLARK, Appellant,
v.
STATE of Florida, Appellee.
No. 2D09-1852.
District Court of Appeal of Florida, Second District.
February 5, 2010.
*136 Todd Matthew Clark, pro se.
Bill McCollum, Attorney General, Tallahassee, and Danilo Cruz-Carino, Assistant Attorney General, Tampa, for Appellee.
WALLACE, Judge.
Todd Matthew Clark appeals the denial of his motion to correct an illegal sentence filed under Florida Rule of Criminal Procedure 3.800(a). In his motion, Mr. Clark sought jail credit for the time that he spent first in the secure lockdown unit of a psychiatric hospital and later in a nonsecure drug treatment facility. Mr. Clark was ordered to both of these facilities after his arrest but before any determination of guilt. Because Mr. Clark's time in the secure facility was the functional equivalent of jail and a coercive deprivation of liberty, we conclude that the postconviction court erred by denying his request for credit for time served in that facility. We affirm the postconviction court's denial of Mr. Clark's request for credit for the time he spent in the nonsecure drug treatment facility.

I. THE FACTS AND PROCEDURAL HISTORY
Mr. Clark was arrested on charges of aggravated assault on law enforcement officers following a standoff with sheriff's deputies at his home. During a bond hearing held prior to determination of guilt, Mr. Clark was ordered to a "medical furlough" in the secure lockdown unit of the psychiatric hospital subject to stringent controls: (1) Mr. Clark was to be transported to the hospital by sheriff's deputies; (2) he was to be held at the hospital "under police hold"; (3) he was not permitted to leave the hospital absent a court order; and (4) upon his discharge from the hospital, he was to be returned to the county jail. After spending 177 days in the psychiatric hospital, Mr. Clark's "medical furlough" was amended at his *137 request and he was released to a nonsecure drug treatment facility.
Subsequently, Mr. Clark pleaded guilty to three counts of aggravated assault on law enforcement officers. The trial court imposed a split sentence on each of the three counts. Mr. Clark was sentenced to a term of twelve years on each count. After serving a three-year mandatory minimum term in prison, the remainder of the sentence was suspended and Mr. Clark was to be placed on probation for a period of nine years. The sentences were designated to run concurrently. The trial court also granted Mr. Clark ninety-three days' jail credit for the time he had spent in the county jail.

II. DISCUSSION
Where the State, prior to any determination of guilt, assumes total custody of a defendant, even if constructive, and such custody is the functional equivalent of jail, the defendant is entitled to jail time credit. Tal-Mason v. State, 515 So.2d 738, 740 (Fla.1987). The trial court's order placing Mr. Clark "under police hold" in a locked unit at the psychiatric hospital constituted an assumption by the State of total custody of Mr. Clark. Absent a court order, Mr. Clark was prohibited from leaving the secured confines of the hospital. Upon medical discharge from the hospital, he was not to be at liberty but rather to be returned to the county jail. Unquestionably, Mr. Clark's detention in the hospital was intended to be and was a "coercive deprivation of liberty." Id. Mr. Clark "was not free on bail, had no control over his place of custody and was never free to leave the hospital[]. For all practical intents and purposes, he was still in jail." See id. (quoting State v. Mackley, 220 Kan. 518, 552 P.2d 628, 629 (1976)); see also Maniccia v. State, 931 So.2d 1027, 1029 (Fla. 4th DCA 2006) (quoting the foregoing statement from Tal-Mason).
Mr. Clark's detention in the psychiatric hospital was the functional equivalent of his detention in the county jail. Accordingly, the postconviction court erred in failing to correct his sentence by granting him credit for the 177 days that he spent there.

III. CONCLUSION
We affirm the postconviction court's order to the extent that it denied Mr. Clark credit for the time he spent in the nonsecure drug treatment facility. We reverse the order to the extent that it denied Mr. Clark credit for the time he spent in the psychiatric hospital. We remand for the postconviction court to enter an order correcting Mr. Clark's sentence by awarding him credit for the 177 days that he spent in the psychiatric hospital.
Affirmed in part, reversed in part, and remanded.
LaROSE and CRENSHAW, JJ., Concur.
