(a) Institution of Proceedings.—In relation to a person who is in the custody of the Bureau of Prisons, or who has been committed to the custody of the Attorney General pursuant to section 4241(d), or against whom all criminal charges have been dismissed solely for reasons relating to the mental condition of the person, the Attorney General or any individual authorized by the Attorney General or the Director of the Bureau of Prisons may certify that the person is a sexually dangerous person, and transmit the certificate to the clerk of the court for the district in which the person is confined. The clerk shall send a copy of the certificate to the person, and to the attorney for the Government, and, if the person was committed pursuant to section 4241(d), to the clerk of the court that ordered the commitment. The court shall order a hearing to determine whether the person is a sexually dangerous person. A certificate filed under this subsection shall stay the release of the person pending completion of procedures contained in this section.
(b) Psychiatric or Psychological Examination and Report.—Prior to the date of the hearing, the court may order that a psychiatric or psychological examination of the defendant be conducted, and that a psychiatric or psychological report be filed with the court, pursuant to the provisions of section 4247(b) and (c).
(c) Hearing.—The hearing shall be conducted pursuant to the provisions of section 4247(d).
(d) Determination and Disposition.—If, after the hearing, the court finds by clear and convincing evidence that the person is a sexually dangerous person, the court shall commit the person to the custody of the Attorney General. The Attorney General shall release the person to the appropriate official of the State in which the person is domiciled or was tried if such State will assume responsibility for his custody, care, and treatment. The Attorney General shall make all reasonable efforts to cause such a State to assume such responsibility. If, notwithstanding such efforts, neither such State will assume such responsibility, the Attorney General shall place the person for treatment in a suitable facility, until—
(1) such a State will assume such responsibility; or
(2) the person's condition is such that he is no longer sexually dangerous to others, or will not be sexually dangerous to others if released under a prescribed regimen of medical, psychiatric, or psychological care or treatment;
whichever is earlier.
(e) Discharge.—When the Director of the facility in which a person is placed pursuant to subsection (d) determines that the person's condition is such that he is no longer sexually dangerous to others, or will not be sexually dangerous to others if released under a prescribed regimen of medical, psychiatric, or psychological care or treatment, he shall promptly file a certificate to that effect with the clerk of the court that ordered the commitment. The clerk shall send a copy of the certificate to the person's counsel and to the attorney for the Government. The court shall order the discharge of the person or, on motion of the attorney for the Government or on its own motion, shall hold a hearing, conducted pursuant to the provisions of section 4247(d), to determine whether he should be released. If, after the hearing, the court finds by a preponderance of the evidence that the person's condition is such that—
(1) he will not be sexually dangerous to others if released unconditionally, the court shall order that he be immediately discharged; or
(2) he will not be sexually dangerous to others if released under a prescribed regimen of medical, psychiatric, or psychological care or treatment, the court shall—
(A) order that he be conditionally discharged under a prescribed regimen of medical, psychiatric, or psychological care or treatment that has been prepared for him, that has been certified to the court as appropriate by the Director of the facility in which he is committed, and that has been found by the court to be appropriate; and
(B) order, as an explicit condition of release, that he comply with the prescribed regimen of medical, psychiatric, or psychological care or treatment.
The court at any time may, after a hearing employing the same criteria, modify or eliminate the regimen of medical, psychiatric, or psychological care or treatment.
(f) Revocation of Conditional Discharge.—The director of a facility responsible for administering a regimen imposed on a person conditionally discharged under subsection (e) shall notify the Attorney General and the court having jurisdiction over the person of any failure of the person to comply with the regimen. Upon such notice, or upon other probable cause to believe that the person has failed to comply with the prescribed regimen of medical, psychiatric, or psychological care or treatment, the person may be arrested, and, upon arrest, shall be taken without unnecessary delay before the court having jurisdiction over him. The court shall, after a hearing, determine whether the person should be remanded to a suitable facility on the ground that he is sexually dangerous to others in light of his failure to comply with the prescribed regimen of medical, psychiatric, or psychological care or treatment.
(g) Release to State of Certain Other Persons.—If the director of the facility in which a person is hospitalized or placed pursuant to this chapter certifies to the Attorney General that a person, against whom all charges have been dismissed for reasons not related to the mental condition of the person, is a sexually dangerous person, the Attorney General shall release the person to the appropriate official of the State in which the person is domiciled or was tried for the purpose of institution of State proceedings for civil commitment. If neither such State will assume such responsibility, the Attorney General shall release the person upon receipt of notice from the State that it will not assume such responsibility, but not later than 10 days after certification by the director of the facility.