A brief statement of the facts as *395presented in the record will best illustrate the proceedings had before the district court, and the questions submitted for our adjudication upon this appeal.
At the October term, 1885, of the district court of Karnes county, E. J. Trader was indicted for murder. The venue was changed to, and the indictment filed in, the district court of DeWitt county, on the thirty-first day of October, 1885. In said latter court it appears that Trader was d.uly and regularly admitted to bail to answer said indictment, and thereby was released from corporeal confinement and custody. He left DeWitt and went to Eastland county, where his wife, his father and other relatives resided.
On the thirtieth day of April, 1887, an information in writing, under oath and in terms of the law (Rev. Stats., art. 106) was made to the county judge of Eastland county, by the father, that his son, E. J. Trader, was a lunatic, or non compos mentis. By regular proceedings had in conformity with the statutes in such cases made and provided (Rev. Stats., art. 106 to 114, inclusive) a trial of his lunacy was had, and by verdict and judgment rendered thereon, on the fifth of May, 1887, in the county court of East-land county, said E. J. Trader was declared a lunatic, and ordered to be conveyed to the lunatic asylum at Terrell for restraint and treatment. His relatives and friends, however, having proposed to undertake his care and restraint, and to execute a bond to that effect, were permitted to do so, and he was duly turned over to their care and custody, under the provisions-of article 118, Revised Statutes. Whilst so in their custody, Trader, who was a physician by profession, was allowed to,.and engaged in, the practice of medicine to some extent.
At the September term, 1887, of the district court of DeWitt county, when the murder case against Trader was called for trial, and he was found not present to answer to the indictment, his bail bond was regularly forfeited, and alias capias for his arrest was awarded, which issued the fifteenth day of Septemtember, 1887, and came into the hands of the sheriff of Eastland county, and was by him executed by arresting the defendant on the twentieth day of September, 1887.
Upon application to him for that purpose by the relatives and friends of Trader, who had as aforesaid given bond for his keeping, custody and restraint as a lunatic, the Hon. T. H. Conner, judge of the forty-second judicial district, of which Eastland county was one of the counties in said district, granted to the *396said applicants a writ of habeas corpus to have the legality of the arrest of Trader under the alias capias from De Witt district court tested, and for his discharge from arrest under said writ and restoration to their custody as his legal guardians and bondsmen by virtue of the judgment of the county court of East-land county on the trial de lunático inquirendo.
The habeas corpus was granted by Judge Conner, and a full return, made to the same by the sheriff of Eastland county, setting forth the facts and the alias capias as his authority for his arrest and detention of the alleged lunatic. A hearing was had by Judge Conner under the writ of habeas corpus, on the first of October, 1887, and the result was that he remanded Trader to the custody of the sheriff instead of to the applicants, his bondsmen. From this judgment the bondsmen appeal to this court.
A motion is here made by the assistant attorney general to. dismiss the appeal because Judge Conner had no jurisdiction to hear and determine the case on habeas corpus, and that consequently this court can have and acquire no jurisdiction by the appeal. .Had Judge Conner refused to grant the writ, or refused to hear and dispose of it upon its merits, then we are of opinion that there could be no question but the motion would have been well taken. This, however, is not the case presented. All district judges under the Constitution are authorized to grant the writ of habeas corpus in felony cases (Const., art. 5, sec. 8), and it is expressly provided by statute that “every provision relating to the writ, of habeas corpus shall be most favorably construed in order to give effect to the remedy and protect the rights of the person seeking relief under it.” (Code Crim. Proc., art. 134.) Another rule well settled is that “a party’s right to the writ does not depend upon the legality or illegality of his original caption, but upon the legality or illegality of his present detention.” (Ex Parte Coupland, 26 Texas, 387.)
There is great plausibility in the able argument and brief of counsel for relator, to the effect that Trader being a citizen of Eastland county, and becoming insane, the county court of that county was the proper forum in which to inquire into and determine the question, and that, when it had once determined the question by judgment and conviction of lunacy, such judgment was binding until set aside or discharged in that forum, and that any interference with said judgment by any other tribunal would be unauthorized and illegal. In our view of the case it is unnecessary to discuss these matters. It is strongly insisted that *397there is no mode provided by our law by which the sanity of a party can be inquired into in the district court before a trial is commenced on the merits of a case upon indictment; and that, if insane, or he becomes so after the commission of an offense, he can not be put upon trial for the same while in such condition. The latter proposition is statutory. (Penal Code, art. 39.) But in construing this same article in Guagando v. The State, 41 Texas, 626, the Supreme Court held that when a defendant charged with felony has become insane a jury should be impaneled to try the issue of insanity before proceeding with the cause upon the merits.
It is insisted by the Assistant Attorney General that the habeas corpus should have been made returnable by Judge Conner to and before the district court of Karnes county, and that the former, if he had authority to issue it at all, had no authority or jurisdiction to hear and determine the same; and in support of this position he cites article 137, Code of Criminal Procedure, which declares that “after indictment found the writ (of habeas corpus) must be made returnable in the county where the offense has been committed on account of which the applicant stands indicted” (Ex parte Ainsworth, 27 Texas, 731); and article 138, Code Criminal Procedure, which provides that in all cases where a person is confined on a charge of felony, and indictment has been found against him, he may apply to the district judge of the district court for the district in which he was indicted, etc.
In this case the trouble is that Trader in effect was in confinement or subject to custody by process of two different courts, legally empowered to act as they had done, and which two different authorities had created for and on his account liabilities conflicting in character. Under the peculiar facts of the case we are of opinion Judge Conner had authority to grant the writ of habeas corpus, but we think he should have made it returnable before Judge Pleasants, the district judge of Karnes county, where the offense was committed for which the applicant stood indicted, and who could have disposed legally of all questions pertaining to the status of the defendant with reference to his trial under the indictment for murder.
This being tftir solution of the matter, the judgment herein rendered below will be set aside, and it is ordered that the writ of habeas corpus be made returnable before Judge H. Clay Pleasants, judge of the twenty-fourth judicial district of Texas, who wilf designate the time and place for hearing the same in *398Karnes county, and give the parties interested due notice thereof. It is further ordered that the sheriff of Eastland county hold the applicant E. J. Trader in his custody, subject to the orders of the said judge of the twenty-fourth judicial district, “to be proceeded With according to law.” (See Rev. Stats., art. 118.)
Opinion delivered November 26, 1887.Ordered accordingly.