G. S., 17-39, provides that the custody of children may be determined in a contest between husband and wife, living in a state of separation but not divorced, upon writ of habeas corpus in which the contesting parties and the child or children are brought into the court for a hearing of the controversy. Such a proceeding is at Chambers, and notwithstanding the fact that it is statutory, the jurisdiction of the court in the premises is unquestionably equitable, has long been so regarded in practice, and that principle has not been questioned in this jurisdiction. The wide latitude given the court in investigating and determining the controversy and the definite personal nature of the orders necessary to be made, and the fact that the welfare and rights of infants are involved, would necessarily brand the jurisdiction as one of equity and not of law, and authorities so declare. Re Badger, 286 Mo., 139, 226 S. W., 936; 14 A. L. R., 286, Annotation 285, 308; Hancock v. Dupree, 100 Fla., 617, 129 So., 822.
When the jurisdiction is invoked, a judgment based on consent of parties in a proceeding of this kind is, therefore, not a mere affirmation of a civil contract. The order operates ex proprio vigore legis, carrying *649with it the sanctions of the jurisdiction invoked. One of these sanctions is imprisonment for contempt of court — sometimes distinguished as civil contempt — for willful refusal to obey its order. Indeed, if this were not so the judgments of a court of equity, often, intimately personal in their nature, would be mere fulminations. The judgment is reversed and the case remanded for proceeding in accordance with this opinion. See Dyer v. Dyer, 212 N. C., 620, 194 S. E., 278; Dyer v. Dyer, 213 N. C., 634, 197 S. E., 157; Vaughan v. Vaughan, 213 N. C., 189, 195 S. E., 351; Vaughan v. Vaughan, 211 N. C., 554, 190 S. E., 492, in which similar principles as touching the jurisdiction and its incidents are applied to judgments based on consent of parties.
For these reasons the judgment of the court below is reversed, and the cause is remanded for further proceedings consistent with this opinion.
Reversed and remanded.