delivered the opinion of the Court.
The relators M. M. Travis and Harry Matthews seek, by *482habeas corpus, a judgment of the Supreme Court discharging them from the custody of the Sheriff of Gregg County, Texas, who holds them under an order of the 124th District Court of Gregg County, convicting relators of contempt, and sentencing them to confinement in the county, jail of Gregg County for twenty-four hours, and fining them $100.00 and taxing against them the costs of the contempt proceedings.
As stated in relator’s petition, the District Court adjudged them in contempt for having, as agents of the Southport Petroleum Company, violated a temporary injunction granted on March 22, 1934, by written fiat of the district judge duly endorsed on the petition that day filed, in a suit brought against the Southport Petroleum Company by the State of Texas, such temporary injunction restraining the Company and relators as its agents from transporting and handling crude petroleum without compliance with an order of the Railroad Commission of Texas, of date February 15, 1933; and also restraining the Company and its agents from handling, refining and processing crude oil without compliance with an order of the Commission of date September 29, 1933, as re-adopted on March 12, 1934.
The alleged acts of contempt were charged by the State’s motion filed on April 5, 1934, to have been committed on April. 1st, April 2nd, and April 3rd, 1934. Relators admitted on the hearing in this Court that appeal from the temporary injunction was duly perfected to the Court of Civil Appeals at Texarkana, and that the appeal was still pending in that Court.
The motion to punish relators was heard on April 27, 1934, by the District Court, and the judgment of that Court declaring relators guilty and ordering their punishment was rendered on April 27, 1934. Thereafter, petition of habeas corpus was presented to the Supreme Court.
The ground urged for discharge of the relators by this Court is the absence of evidence before the District Judge and the District Court showing that relators violated any valid order of the Commission or provision of the temporary injunction.
The statute under which the appeal was taken by the Southport Petroleum Company provides that any party to any suit “wherein a temporary injunction may be granted * * * may appeal from such order or judgment to the Court of Civil Appeals by filing a transcript of such case with the clerk of said appellate court not later than 20 days after-the entry of record of such order or judgment.” (Italics ours.) Art. 4662, Volume 14, Vernon’s Ann. Texas Civil Statutes, page 117.
*483Construing the same language in an earlier statute, the Supreme Court in Chief Justice Brown’s opinion in Baumberger v. Allen, 101 Texas, at page 357, said: “We think that the
filing of the petition with the order endorsed thereon constitutes the ‘entry of record of such order.’ ” The same construction is given the statute in Ex parte Rains, 113 Texas, 433, opinion by Chief Justice Cureton.
It necessarily follows under the admission of relators, that before the District Court tried the relators for contempt, April 27, 1934, the appeal from the temporary injunction had been perfected by the filing of transcript not later than April 11th, that being the twentieth day after March 22nd.
The relators have presented to this Court the brief in the Court of Civil Appeals showing that the sole ground for the appeal there pending is that, “The district court was without authority to issue said injunction, and we desire to discuss the question of the validity of the injunction because of his lack of authority.” The propositions urged for vacation of the temporary injunction sustain the above statement.
The motion of the State to punish for contempt in the district court was based entirely on averments of violations of the temporary injunction. The answer by relators to the motion raises the same questions as those on which the appeal is prosecuted, the first section of this answer reading: “First. That said Injunction is in all things void for the reason that the facts alleged in the Plaintiff’s petition are insufficient and do not warrant the issuance of said Injunction; that the Court was without power and authority to issue said Injunction.”
It thus appears that the district court undertook to have a trial to determine the validity of its injunction, on motion for contempt, after the jurisdiction of the Court of Civil Appeals had fully attached for the determination of that precise question.
The general rule applies here, which is stated in 3 Texas Jurisprudence, at page 369, in section 262, in the following words: “As a general rule the perfection of an appeal or writ of error terminates the authority of the lower court pending the appeal, in respect of all matters which trench upon the appellate functions, so that the lower court may not thereafter proceed in the cause, at least as to the subject matter of the appeal or writ" (Italics ours.) If this were not true, a Court of Civil Appeals would be powerless to enforce its own jurisdiction. Yet, a valid statute expressly declares, referring to Courts of Civil Appeals, that “said' courts and the judges *484thereof may issue writs of mandamus and all other writs necessary to enforce the jurisdiction of said courts.” Article 1823, Vernon’s Ann. Texas Statutes.
There must be an end to orderly administration of justice if at the same time two separate courts entertaining different views could exercise the power to adjudicate the same question. The Texarkana Court of Civil Appeals correctly announced more than a quarter of a century ago that:
“After the appeal is thus perfected (i. e. by notice and cost bond), then the trial court loses its power in respect to those-things %ohich might trench on the appellate functions, and the jurisdiction of the Court of Civil Appeals attaches.” (Italics ours.) Gordon v. Rhodes & Daniels, 104 S. W., 786.
After the jurisdiction of the Appellate Court attached, it alone was clothed with the power to adjudicate the validity or invalidity of the temporary injunction and to exercise the discretion involved in compelling obedience to the injunction pending the appeal, as well as to enforce its own final judgment, unless or until such judgment was subjected to review by a higher court. The district court could exercise no such authority while power to consider and determine these very matters lay exclusively in a higher court. Churchill v. Martin, 65 Texas, 367, 369; Wells v. Littlefield, 62 Texas, 30; Ford v. State, 209 S. W., 491; Hurley v. Buchanan, 233 S. W., 590.
As declared in Texas Jurisprudence: “Habeas corpus is a collateral, not a direct attack on the proceedings under which the restraint complained of has been imposed.” * * * “Habeas corpus is an extraordinary writ. The general rule is that it does not lie when relief may be had or could have been procured by resort to another remedy.” 21 Texas Jurisprudence, pp. 424, 425, 426. Ex parte Lipscomb, 111 Texas, 415, 416, 239 S. W., 1101, and Ex parte Bearner and Seay, 116 Texas, 39, 285 S. W., 255, settle that habeas corpus is a collateral remedy and that its function is not to supersede a prompt and adequate and more direct remedy by appeal. Upon original application for habeas corpus to the United States Supreme Court it was said in an opinion by Chief Justice Fuller, referring to the Supreme Court in the District of Columbia as the trial court, that:
“If judgment goes against petitioner and is affirmed by the court of appeals and a writ of error lies, that is the proper and better remedy for any cause of complaint he may have. If, on the other hand, a writ of error does not lie to this court, and the supreme court of the District was absolutely without *485jurisdiction, the petitioner may then seek his remedy through application for a writ of habeas corpus. We discover no exceptional circumstances which demand our .interposition in advance of adjudication by the courts of the district upon the merits of the case before them.” Re Elverton R. Chapman, 156 U. S., 211, 39 L. Ed., 401.
There is no sound reason for a different rule in civil and in criminal cases. Speaking of the remedy of habeas corpus, in criminal cases, the United States Supreme Court said:
“If defenses may be omitted at trials, rights of review omitted, and yet availed of through habeas corpus, the whole course of criminal justice will be deranged, and, it may be, defeated. This is the practical result in the case at bar. And, illustrating their arguments, petitioners told us of other cases which are waiting to come forward with ah appeal for like remedy and jail delivery.” In the Matter of the Application of Spencer ex parte et al., 228 U. S., 652, 57 L. Ed., 1010.
Courts clothed with power to issue writs of habeas corpus should use a wise discretion in its exercise. As observed in 29 C. J., Sec. 20, p. 32: “But while want of jurisdiction is ground for relief by habeas corpus, this is subject to the rules as to discretion in issuance of the writ, and the rule against interference with pending proceedings where there is an adequate remedy by trial and appeal or error in ordinary course.”
The Supreme Court in the case of Staples v. State ex rel., 112 Texas, 73, 245 S. W., 61, having determined on certified question that a temporary injunction had been issued by a District Court without jurisdiction, which, by order of the District Judge, was to remain in full force pending the appeal, made the necessary order to protect this Court’s own jurisdiction, as well as that of the Court of Civil Appeals. In that case, the Court per Mr. Justice Pierson said:
“It is manifest that jurisdiction could not be exercised by the District Court, pending the appeal, without conflict with the undoubted jurisdiction of this court and of the Court of Civil Appeals. Conley v. Anderson, 164 S. W., 985; Hovey v. Shepherd, 105 Texas, 242, 147 S. W., 224. It is therefore ordered by this Court, as essential to the enforcement of its own jurisdiction, as well as that of the Court of Civil Appeals, that no further proceedings be had in the quo warranto cause by the District Judge or by the District Court of Navarro County-pending the final judgment of the Court of Civil Appeals, wherein all directions may be given essential to the complete enforcement of the jurisdiction of the Court of Civil Appeals.”
*486The one fact which is decisive against the exercise by us of the power to release relators is that every right to which they may be entitled can be fully protected by the Court of Civil Appeals in the exercise of jurisdiction which was invoked before that of the Supreme Court.
Because relators were entitled to ask of the Court of Civil Appeals, on the appeal of their principal, all the relief here sought, and because that Court was and is possessed of ample power to decide their right to such relief in the pending direct attack upon the temporary injunction, the Supreme Court will refuse to exercise the power but will dismiss the petition for the writ.
It is therefore ordered that relators’ petition be dismissed and that they be .remanded to custody, without prejudice, however, to their right to petition the Court of Civil Appeals at any time after the filing of this opinion, for any and all relief to which they may deem themselves entitled, and which that Court may lawfully exercise in full protection of its own jurisdiction.