
821 So.2d 1169 (2002)
Walter FACYSON, Jr., Petitioner,
v.
Ken JENNE, as Sheriff of Broward County, Florida, Kathleen Kearney as Secretary of the Department of Children and Families, and State of Florida, Respondents.
No. 4D02-2496.
District Court of Appeal of Florida, Fourth District.
July 19, 2002.
Rehearing Denied August 12, 2002.
*1170 Alan H. Schreiber, Public Defender, and Diane M. Cuddihy, Assistant Public Defender, Ft. Lauderdale, for petitioner.
Kimberly A. Kisslan, Acting General Counsel, Ft. Lauderdale, for Respondent-Ken Jenne.
Douglas Greenbaum, Ft. Lauderdale, for Respondent-Kathleen Kearney as Secretary of the Department of Children and Families.
Robert A. Butterworth, Attorney General, Tallahassee, and Donna M. Hoffmann, Assistant Attorney General, West Palm Beach, for Respondent-State of Florida.
STONE, J.
Petitioner seeks release from detention in the Broward County Jail and/or a writ directing the Department of Children and Families (the department) to take immediate custody of him.
The issue posed is whether a defendant who has been determined incompetent to stand trial may be detained in jail longer than the fifteen days allowed by section 916.017(1)(a), Florida Statutes. All of the affected parties are before this court.
Section 916.107(1)(a), which contains a "bill of rights" for forensic detainees, provides that a jail may be used as an emergency facility for up to 15 days from the date the department receives a completed copy of the commitment order containing the documentation required by Rules 3.212 and 3.217, Florida Rules of Criminal Procedure. It is undisputed that Petitioner's continued detention results from insufficient forensic bed space in which to place committed defendants within the time allotted in the statute. The department contends that this is a result of inadequate funding.
A hearing was held before the trial court. Representatives of the department and the state acknowledged at the hearing that the least restrictive alternative for Petitioner was placement in a forensic hospital. The trial court denied Petitioner relief, as the court was not willing to move Petitioner ahead of others awaiting placement.
The state contends that release is not an option, noting that Petitioner was arrested for a crime of violence, attempted murder, by knife, of a law enforcement officer. The department acknowledges that release likely will result in Petitioner's re-arrest after causing additional harm to himself or society. Although the Broward County Jail may have facilities for temporarily caring for and treating Petitioner, only the department has the statutory duty to provide competency restoration; the sheriff is not required to do so, nor is the jail equipped or budgeted to provide such treatment.
The department asserts that although the fifteen day provision may have been *1171 reasonable when the statute in question was enacted, it no longer is, due to the increasing number of persons committed.
It is clear that the department is responsible for Petitioner's care and custody. Notwithstanding insufficient funding, the department is charged with the responsibility for maintaining secure facilities and programs for treating defendants charged with felonies who are determined incompetent to proceed and who cannot be treated in a less restrictive setting. Section 916.13(2) also speaks of the department's responsibility.[1]
Although this court has the power to release individuals who are being detained without legal authority, we do not deem such to be an appropriate remedy in this case at this time. For that reason, we deny the petition for writ of habeas corpus. However, we find that relief in the nature of mandamus is warranted and grant the petition.
In Miller v. Carson, 524 F.Supp. 1174 (M.D.Fla.1981), the city of Jacksonville claimed that the department (formerly HRS) had violated the terms of a mandatory injunction, and the federal district court granted relief in the nature of mandamus to require the department to take custody of inmates of the Duval County Jail within seventy-two hours after they are declared mentally incompetent, as the court had determined that the jail lacked adequate facilities in which to house mentally incompetent inmates. The court reasoned that immediately upon the inmate's commitment for involuntary hospitalization, the inmate becomes a ward of the department and the department must accept physical custody of the inmate within the time period set by the court. If the department lacked bed space, that did not demonstrate its inability to comply. The court rejected the department's contention that relief in the nature of mandamus did not lie, concluding that the department's duty to take physical custody of inmates committed to its treatment facilities was ministerial.
We recognize that in State, Department of Health and Rehabilitative Services v. Maxwell, 667 So.2d 980 (Fla. 4th DCA 1996), this court reversed an order holding the department in contempt for failing to move an incompetent defendant from the county jail to an appropriate facility within the fifteen-day period specified in section 916.107(1)(a). There, as here, the department representative explained that the defendant had not been transferred due to a lack of bed space due to inadequate funding. The record reflected that Maxwell was due to be transported within three days. Although we continue to acknowledge that before the department can be held in contempt, the trial court must be able to make an express finding that the department had the ability to comply or that its refusal to comply was willful, contempt is not an issue here.
We note that an immediate contempt is not the only method of enforcing compliance, but, at a minimum, the department should be expected to promptly comply with any orders of the trial court requiring bed space status reports, and to furnish such plan for compliance as the court may require, including making arrangements *1172 with the sheriff for temporary care and treatment at the department's expense.
We charge the trial division having jurisdiction of Petitioner's case, or such other judge that may be assigned by the chief judge, with the enforcement of this writ.
SHAHOOD and TAYLOR, JJ., concur.
NOTES
[1]  The sheriff also advises that the department routinely fails to place defendants committed to it for competency restoration within the fifteen-day period, costing the sheriff's office tens of thousands of dollars each year. Although the sheriff asks this court to address the department's responsibilities to defendants similarly situated, as well as the department's responsibilities to the sheriff's office, we deem such to be outside the scope of the instant petition.
