By our statute, chap. 142, the writ de homine replegiando lies in favor of a person unlawfully deprived of his liberty, and it must be prosecuted in his own name and for his own benefit. It does not lie in favor of a party to recover one, who owes service to him by contract. It may be sued out by any person in behalf of a plaintiff, but still it must be *564for his benefit, and the assistance must be rendered to him by the person procuring it.
If the plaintiff, when the action was commenced, was not unlawfully imprisoned or restrained of her liberty, it cannot be maintained. It appears by the exceptions, that she was then about seventeen months old, and was residing with her father and under his care and protection. He is under legal obligations to support and maintain his children, and generally is entitled to the custody and control of their persons. But it is contended that he has made a parole contract with the grand-, mother of the child, and has transferred the custody to her, and in violation of his agreement, has taken the child from the grandmother, to whom the child had been given by him and his deceased wife. It is moreover contended, that this contract is in its nature irrevocable on the part of the father, and that he cannot retain the possession of his daughter in opposition to it.
If it were admitted, that such contract was legal and binding upon the parties to it, the consequence would not follow that this action could be maintained, though damages might be recovered for the breach of it. Our law does not appear to have provided any remedy for the specific execution of such contract. The refusal of the father to perform it does not convert a lawful custody of one’s child into an unlawful imprisonment. The plaintiff has no right to interfere with the contracts of her father^ made with a third person, or to prescribe his line of duty. She has no legal connection with them, and although they may have relation to her, she is not a party to them in the contemplation of law. This writ has regard to the relations between the parties themselves, and cannot be sustained, unless the plaintiff is entitled to her liberty in her own right, and by the law applicable to her as a child, and to the defendant as her father. If the power to an entire control of herself during minority can ever be obtained, it must result from a legal agreement to that effect between her and her father. She cannot call in aid a contract made between her father and a third person ; the observance or the *565breach of it, however her happiness may be affected, cannot determine her rights.
This action appears to have been commenced, not to relieve the plaintiff from an actually existing unlawful imprisonment or restraint, but to coerce the defendant into a performance of the alleged contract. Neither the language nor the spirit and intent of the statute can justify such use of it. It was enacted for the exclusive benefit of the party held in a custody, not authorized by the legal relations between the parties to the record. The Legislature did not intend, that a third person might resort to this process, and using the name of an infant, and under an alleged agreement with the father,. take the infant from the arms of the parents. There is nothing in the statute that requires or warrants such construction. And in the opinion of the court, this action cannot be maintained, and the jury should have been so instructed, agreeably to the request of the defendant.
Upon habeas corpus the court may exercise a discretion in relation to the disposition, of a child, which it is unable to do in this action. But it is gratifying to know, that the respectability and good character of those, who are contending for the custody of the plaintiff, furnish a sufficient guaranty of her proper treatment in the hands of either.
Exceptions sustained, verdict set aside, and a new trial granted.