(3) Upon receipt of a certificate of the veterans administration or such other agency of the United States that facilities are available for the care or treatment of any person heretofore committed to any hospital for the insane or other institution for the care or treatment of persons similarly afflicted and that such person is eligible for care or treatment, the superintendent of the institution may cause the transfer of such person to the veterans administration or other agency of the United States for care or treatment. Upon effecting any such transfer, the committing court or proper officer thereof shall be notified thereof by the transferring agency. No person shall be transferred to the veterans administration or other agency of the United States if he or she be confined pursuant to conviction of any felony or misdemeanor or if he or she has been acquitted of the charge solely on the ground of insanity, unless prior to transfer the court or other authority originally committing such person shall enter an order for such transfer after appropriate motion and hearing. Any person transferred as provided in this section shall be deemed to be committed to the veterans administration or other agency of the United States pursuant to the original commitment.