Jurisdiction is inherent in the State over persons within its limits who have been deprived of the use of their mental faculties. It is the duty of the State to protect the community and the mentally ill from their own acts. If insane, their detention is sanctioned under the police power of the State. A mentally ill person may be deprived of his liberty and, if once adjudged to be insane, that person has been deprived of no constitutional right, State or Federal (Sporza v. German Sav. Bank, 192 N. Y. 8). Commitment for an indefinite time is legal where, as here, the statute makes provision for the mentally ill person to contest, by proof of his sanity, the legality of his confinement after admission (Matter of Coates, 9 N Y 2d 242). It is the policy of the State to care for and protect mentally ill persons and, if possible, to cure them of disease (Sporza v. German Sav. Bank, supra). But this policy does not confer on the mentally ill person a right to release in the event of claimed inadequate treatment. It is conceded that petitioner is sufficiently mentally ill to require continued medical treatment. Beldock, Ughetta, Kleinfeld and Christ, JJ., concur; Nolan, P. J., concurs in the result, with the following memorandum: I am not prepared to say that a writ of habeas corpus should not issue to inquire into the propriety of petitioner’s detention at the Creedmoor State Hospital, even though relief other than that of absolute discharge might be the only result of a proceeding so instituted (cf. People ex rel. Brown v. Johnston, 9 N Y 2d 482). I agree, however, that it was not error to deny a motion, not made in any pending action or proceeding, for an oral examination of respondent concerning the medical, rehabilitative and custodial care given petitioner, and for a writ designated as a writ of habeas corpus directing respondent to appear thereafter at a hearing lo inquire into the lawfulness of petitioner’s detention.