By his petition for writ of habeas corpus Joel D. Gebhardt alleged that he is confined to the Dade County Jail as a material witness in a first-degree murder case, and that his confinement is illegal because he has not been discharged pursuant to § 902.17(4) Fla.Stat., F.S.A. This Court issued a writ of habeas corpus and a return has been duly filed. In addition we have received briefs and heard oral argument upon the question involved. The following portions of the return to the writ are not controverted but are in accord with the position taken by the petitioner in argument before this Court. They adequately set forth the facts material to the question to be considered.
“2. That the Relator is in the custody of Respondent pursuant to and by virtue of an order entered by the Honorable Francis J. Christie, Judge of the Circuit Court, Eleventh Judicial Circuit, on September 29, 1964, wherein Relator was ordered to post a material witness bond of $25,000 or remain in the custody of Respondent until criminal cases then pending against one Richard Worthington in the Circuit Court were terminated. A certified copy of said order is attached to the Answer of Respondent heretofore filed in this cause, and is made a part hereof.
“3. That on September 9, 1964, the Relator and one Richard Charles Worthington were bound over to the Dade County Grand Jury by the Honorable Ruth Sutton, Justice of the Peace, Third District, on warrants charging the Relator and Richard Charles Worthington with Murder in the First Degree of Angela Worthington and Charles Worthington.
“4. That on September 29, 1964, the Dade County Grand Jury returned true bills against the said Richard Charles Worthington charging him in Circuit Court Case Nos. 2183 and 2184 with murder in the first degree of Angela and Charles Worthington.
“5. That the Relator entered into an agreement with the State of Florida and the Dade County Grand Jury that he would testify in the pending cases against Richard Charles Worthington in exchange for his not being prosecuted, and in furtherance of said agreement, the Dade County Grand Jury, on September 29, 1964, returned no true bills on the charges pending against the Relator.
“As evidence of said agreement, there is attached hereto and made a part hereof a certified copy of an Interim Report of the said Dade County Grand Jury, dated October 6, 1964, which sets forth the Grand Jury’s reasons for entering into the said agreement.
“6. That in order to insure the Relator’s compliance with his agreement with the State of Florida, the State Attorney moved the Circuit Court to set a material witness bond for the Relator.
“7. That on September 29, 1964, the Honorable Francis J. Christie, Circuit Judge, entered the aforementioned Order declaring the Relator to be a material witness in the cases pending against Richard Charles Worthington and setting a bond in the amount of $25,000.00.
“8. That Relator has not complied with the Order of September 29, 1964, in that no bond has been filed, nor has he testified as a material witness in both cases pending against Richard Charles Worthington.
“9. That, pursuant to the agreement entered into between the Relator, The State of Florida, and the Dade County Grand Jury, the Relator appeared and testified in the case of The State of Florida v. Richard Charles Worthington, No. 2184. The case of The State of Florida v. Richard Charles Worthington, No. 2183, was set for trial on April 1, 1965, but the Supreme Court of The State of Florida, after *805hearing arguments on the defendant’s Suggestion for a Writ of Prohibition, issued a Rule Nisi on March 31, 1965, ordering the State to Show cause on April 20, 1965 why the Suggestion should not be granted.”
The case of the State of Florida v. Richard Charles Worthington, No. 2183, was set for trial on April 1, 1965, but has been continued because the defendant, Worthing-ton, has raised legal issues which must first be settled by the Supreme Court of Florida.
The question which we must determine is whether § 902.17 Fla.Stat., F.S.A., applies to this petitioner so that his restraint is now illegal. This section provides as follows:
“902.17 Procedure when witness does not give security.
“(1) If a witness required to enter into an undertaking or recognizance to appear to testify, either with or without security, refuses compliance with an order for that purpose, the magistrate shall commit him to custody until he complies or is legally discharged.
“(2) If the magistrate requires the witness to give security for his appearance, and the witness is unable to give such security, he may move the court having ultimate jurisdiction to try the defendant, for a reduction of said security.
“(3) When it satisfactorily appears by examination on oath of the witness, or any other person, that the witness is unable to give security, the magistrate in the first instance, and the trial court having jurisdiction in the second instance, shall make an order finding such fact, and the witness shall be detained pending application for his conditional examination. Within three days from the entry of the order last mentioned, the witness so detained shall be conditionally examined on behalf of the state or the defendant on application made for that purpose. Such examination shall be by question and answer in the presence of the other party and counsel, and shall be taken down by a court reporter or a stenographer selected by the parties, and reduced to writing. At the completion of the examination, the witness shall be discharged, and his deposition may be introduced in evidence by the defendant at the forthcoming trial, or if the prosecuting attorney and the defendant and his counsel agree, the deposition may be admitted in evidence at the trial, by stipulation. No such deposition shall be admitted on behalf of the state, unless the defendant consents thereto.
“(4) If no conditional examination is had within the above mentioned period of three days, the witness so detained shall be forthwith discharged.
“(5) A witness so committed shall be entitled to his fees as a witness for the period of his commitment.”
It must first be pointed out that the above statute is not the only basis for the authority of the circuit court to hold a necessary and material witness in jail in a first-degree murder case. The authority of such courts to hold a material witness is an element of the jurisdiction to try such cases. It is an inherent power long recognized by the law. Crosby v. Potts, 8 Ga.App. 463, 69 S.E. 582 (1910); Lowe v. Taylor, 180 Ga. 654, 180 S.E. 223 (1935). The courts of Georgia have had opportunity to discuss the subject under consideration. We hereby adopt the reasoning in those cases and set forth the following which is a part thereof:
“[T]he power to take every adequate means to compel the attendance of witnesses or the production of testimony inhered in the courts of the common law as a part of their necessary powers * * *.
“[There is] a plenary power in the courts to exercise over officers, parties, witnesses, and all others who may become connected in any way with a case *806pending before the court, such control as shall be adequate to carry out its full jurisdiction to administer legal justice in the case. Officers may be compelled to perform duties even without pay, as where for a pauper party the sheriff serves papers, or the clerk makes records or copies, or an attorney is appointed and defends. Parties may be compelled to execute consents, or to appear in person, or to submit to physical examinations of themselves, of their property, or of their documents, and in extreme cases may be held in prison awaiting the determination of some asserted right, even of a civil nature, as where a party is held under ne exeat. Third persons may be compelled to lay down their private enterprises in order to come to the court to sit as jurors. Other outsiders may be compelled to appear as witnesses, and to bring their private books and papers to be used as evidence. Many of these things thus required of the citizenry of the state are, on their face, hardships which the relationship of citizen and state impose as the result of a natural and necessary obligation.
“The point is that the court as an arm of .the state has the right to impose hardship upon the citizen whenever the state’s interests being administered in the court require the imposition. It is a hardship upon one, whose only connection with a case is that he happens to know some material fact in relation thereto, that he should be taken into control by the court and held in the custody of the jailer unless he gives bond (which, from poverty, he may be unable to give), conditioned that he will appear and testify; but the exigencies of particular instances do often require just such stringent methods in order to compel the performance of the duty of the witness appearing and testifying. There are many cases in which an ordinary subpoena would prove inadequate to secure the presence of the witness at the trial. The danger of punishment for contempt on account of a refusal to appear is sometimes too slight to deter the witness from absenting himself. Especially is this true where there are but few ties to hold the witness in the jurisdiction where the trial is to be held, and there are reasons why he desires not to testify; for, when once he has crossed the state line, he is beyond the grasp of any of the court’s processes to bring him to the trial or to punish him for his refusal to answer to a subpoena. We conclude, therefore, that since the law manifestly intends that the courts shall have adequate power to compel the performance of the respective duties falling on those connected in any wise with the case, it may, where the exigencies so require, cause a witness to be held in custody, and in jail if need be, unless he gives reasonable bail for his appearance at the trial.
“It is hardly necessary to say that the imprisoning of a witness to secure his attendance is a harsh remedy — one that should be very sparingly exercised. No court should ever order a witness to be imprisoned in default of bond, except from grave necessity. Unless his testimony is material and important, and unless there is strong likelihood that, if he is not restrained by confinement or bond, he will violate the mandates of the subpoena and flee the limits of the state, the power should not be exercised. This is a matter as to which every court, when it is presented, must exercise a broad, humane discretion, having in view the rights of the citizen, and even higher rights of justice and of the state.” Crosby v. Potts, supra, 69 S.E. at 584.
Subsection (4) of Florida Statute 902.17, F.S.A. is remedial in nature and has as its-purpose to provide a means of release from custody those persons held as material witnesses who are unable to give security for their appearance, and who are otherwise entitled to their liberty. The question *807here is whether the petition and the return before us show that the petitioner has brought himself within the scope of the remedial provision of the statute so that his detention is unlawful.
In the instant case the petitioner is by his own confession a murderer. He has received the benefits of, and now attempts to proceed under a petition made by the State Attorney in the circuit court. The petition of the State Attorney set forth that Gebhardt, as a co-murderer, entered into an agreement with the State of Florida and the Dade County Grand Jury that he would testify in cases pending against Richard Worthington (his accomplice who was indicted for the first-degree murder of Angela and Charles Worthington) in exchange for an immunity from prosecution for the crimes they both had committed. It is not necessary for us to comment upon the legality of such an agreement.
It is apparent from the exhibits before us that the so-called agreement resulted in testimony of the present petitioner before a Grand Jury and that the Grand Jury thereafter returned a “no true bill” as to the petitioner Gebhardt for the crime to which he has confessed. He comes before us having admitted that he is in custody pursuant to such an agreement and now claims the benefits of a provision of a statute which provides for the release under certain conditions of indigent persons held as material witnesses.
We reach the conclusion that the petitioner is held under the inherent power of the circuit court to hold a material witness, and since he has been unable to make bond, the interest of justice dictates that he should not be released from custody. The petitioner is not entitled to the benefit of the statute because his incarceration is not a result of the independent action of the State in taking and holding him as a material witness. His incarceration is the result of his own action in allegedly making the agreement to ally himself with the prosecution against Richard Worthington. In other words he acknowledges that this temporary loss of liberty is a result of his own machinations. We hold that his incarceration is not illegal and that it cannot be said to be illegal so long as there is any lawful purpose to be served by that detention. Compare: Ex parte Greenhaw, 41 Tex.Cr.R. 278, 53 S.W. 1024 (1899) and Ex parte Carter, 62 Tex.Cr.R. 113, 136 S.W. 778 (1911), which held that a person indicted as a co-murderer who subsequently agreed to testify on behalf of the State against his co-defendants for the crimes charged would not be entitled to immunity and release from custody until the agreement was consummated.
The writ is discharged and the prisoner is remanded to the custody of the respondent.
It is so ordered.