Whenever any person is detained in a facility after having been charged with or convicted of crime, and is subject to deportation from the Commonwealth under the laws of the United States, the court committing such person, upon the petition of the director of such facility, may enter an order releasing such person from detention into the custody of an agent of the United States for the purposes of deportation.
50 P.S. § 4414