
625 So.2d 945 (1993)
Kenneth Allen PARSONS, Petitioner,
v.
Richard WENNET, As Circuit Judge for the Fifteenth Judicial Circuit and Richard Wille, As the Sheriff of Palm Beach County, Respondents.
No. 93-2810.
District Court of Appeal of Florida, Fourth District.
October 20, 1993.
*946 Ileen Cantor, West Palm Beach, for petitioner.
Robert A. Butterworth, Atty. Gen., Tallahassee, and Charles M. Fahlbusch, Asst. Atty. Gen., Hollywood, for respondents.
PARIENTE, Judge.
Petitioner, Kenneth Allen Parsons, seeks review of an order of civil contempt, which provided for his immediate incarceration for an indeterminate period of time. A criminal contempt order based on the same conduct and entered at the same time was subsequently vacated by the trial court. Because we find the civil contempt order to be an impermissible use of the trial court's power of civil contempt, we grant the writ of habeas corpus and direct the petitioner's discharge. We have previously, by order of September 27, 1993, directed petitioner's release from jail.
Petitioner, Kenneth Allen Parsons, is the paternal grandfather of Melissa Parsons who is claimed to have been abducted by petitioner's son, Earl Parsons, after German courts asked the United States State Department to return Melissa to Germany where her mother resides. On August 24, 1993, the mother, Angelika Parsons, subpoenaed Earl Parsons, the father, for deposition. According to findings made by the trial court, the father fled the deposition, and the petitioner assisted him. On August 25, the petitioner appeared in court pursuant to subpoena to testify about the events of August 24. At the hearing, the petitioner testified under oath that he did not know the whereabouts of his son or granddaughter. At the conclusion of the hearing, the trial court declared that petitioner's testimony was untruthful. The court then summarily entered an order finding the petitioner in direct criminal contempt and entered a separate order of civil contempt.
The court imposed an immediate 30 day sentence for criminal contempt based on a finding that petitioner had committed perjury on at least four occasions in his testimony before the court on August 25. As a basis for the civil contempt order, the court found that the testimony of the petitioner about the whereabouts of his grandchild was not credible, and that petitioner had "knowledge of the whereabouts of both the minor child, Melissa Lee Parsons, and the respondent/husband." The civil contempt order, providing for incarceration for an indeterminate period of time, included a purge provision requiring the petitioner to provide the court with "the exact location, (the name, address and telephone number) of where the minor child, Melissa Lee Parsons, is located," and providing that the petitioner not be released until the child's location was verified. The purge requirement was entered despite the fact that the petitioner had testified under oath that he did not possess this knowledge or information.
On September 8, 1993, pursuant to a sua sponte order, the public defender was appointed to defend the petitioner on the criminal contempt charge after the court found petitioner to be indigent. The next day, the court vacated the criminal contempt order nunc pro tunc, after an ore tenus motion to vacate by the public defender. The court based its order on the authority of Emanuel v. State, 601 So.2d 1273 (Fla. 4th DCA 1992), which holds that a judge may not find an *947 individual in direct criminal contempt of court by weighing conflicting evidence between witnesses. However, notwithstanding the indigency of the petitioner, and his incarceration for civil contempt, the court refused to appoint counsel on the civil contempt. The court did not vacate the civil contempt order, and petitioner remained incarcerated under the civil contempt order until this court directed his release.
There are distinct differences between civil contempt and criminal contempt. Criminal contempt is a crime under Florida law and classified as conduct against the dignity and authority of the court. Such proceedings are punitive in nature. Bowen v. Bowen, 471 So.2d 1274, 1277 (Fla. 1985); Aaron v. State, 284 So.2d 673 (Fla. 1973); Dowis v. State, 578 So.2d 860, 862 (Fla. 5th DCA 1991); In the Interest of S.L.T., 180 So.2d 374 (Fla. 2d DCA 1965). On the other hand, the purpose of a civil contempt proceeding is to obtain compliance on the part of a person subject to an order of the court. Bowen v. Bowen. Civil contempt consists of failing to do something ordered to be done by a court or judge for the benefit of the opposing party. Fisher v. State, 248 So.2d 479 (Fla. 1971); Ducksworth v. Boyer, 125 So.2d 844 (Fla. 1960).
The rules of criminal procedure provide specific procedures for both direct and indirect criminal contempt. Fla. R.Crim.P. 3.830 and 3.840. However, there is no specific rule of procedure for civil contempt, although the rules provide that certain actions may be deemed to be contempt of court. See e.g. Fla.R.Civ.P. 1.380 (failure to answer a question after being directed to do so by the court); Fla.R.Civ.P. 1.410 (failure to obey a subpoena); Fla.R.Civ.P. 1.510 (filing a bad faith affidavit in connection with a motion for summary judgment). Notwithstanding the lack of a specific rule, basic due process requires notice and an opportunity to be heard before sanctions may be imposed. Incarceration in a civil contempt proceeding is used solely to obtain compliance with a court directive, and even then only when the contemnor has the ability to comply with the directive. The ability to comply is the civil contemnor's "key to his cell" entitling him to release upon compliance. Bowen v. Bowen; Pugliese v. Pugliese, 347 So.2d 422 (Fla. 1977).
In this case, the petitioner did not refuse to answer or testify. He did not testify that he knew the whereabouts of his son and granddaughter, but refused to reveal their whereabouts. To the contrary, he responded to a subpoena and testified under oath in court. He answered all questions asked. The court disbelieved the truthfulness of his answers, summarily found the witness in contempt of court, and ordered him jailed without notice and without counsel.
We conclude that the order of civil contempt was inherently defective. By its very nature, the purge provision of the civil contempt order created an impossible catch-22 situation for the petitioner. According to the purge provision, the only way to be set free was for petitioner to admit that he had committed the crime of perjury when he previously testified under oath that he did not know the whereabouts of his grandchild and son. A protest of innocence would necessarily condemn him to jail indefinitely.
By incarcerating the petitioner indefinitely, the court was attempting to require the petitioner to admit he was lying when he testified in court, thereby incriminating himself for the crime of perjury. The state and federal constitutions, of course, prohibit such compelled testimony.
We certainly understand the frustration of the court, especially when the trial court was sitting and judging the credibility of the testimony at a hearing conducted to determine the location of the missing child. We do not tolerate the crime of perjury. As this court has previously stated in Emanuel v. State, 601 So.2d 1273, 1275 (Fla. 4th DCA 1992):
Perjury, of course, constitutes a serious crime and should not be tolerated. The integrity and efficacy of the judicial process in resolving factual disputes rests almost entirely on the integrity of the witnesses and the quality of evidence presented. Perjury poisons the well from which justice flows. That is why, in the appropriate case, a prosecution for perjury should be brought to insure that judicial *948 proceedings are not undermined by those who would intentionally give false testimony.
This case may be one that justifies a prosecution for perjury. However, the court's civil contempt power cannot be used to jail an individual immediately and indefinitely for giving what the court finds to be untruthful testimony and then only provide the keys to the jail cell when the petitioner admits to perjury. The "truth" cannot be extracted in such a manner. A witness may run the risk of incarceration for perjury if it is determined that he has lied under oath, and he may run the risk of incarceration for civil contempt if he refuses to testify when ordered by the court, but we draw the line at indefinite incarceration for a witness whose answers do not satisfy the court. This is simply not how our system of justice functions.
Accordingly, we grant the writ of habeas corpus, deny the writ of mandamus[1], vacate the order of civil contempt and direct that petitioner be discharged. Our holding moots the issue of whether petitioner is entitled to appointed counsel or notice of the contempt proceedings.
ANSTEAD and KLEIN, JJ., concur.
NOTES
[1]  Mandamus is a remedy to compel performance of a ministerial act and will not be issued where a petitioner has other adequate and complete remedies at law. See Broward County v. Coral Ridge Properties, Inc., 408 So.2d 625 (Fla. 4th DCA 1981).
