legal ground
Article 67 of the Criminal Procedure Law
People's courts, people's procuratorates and public security organs may release a criminal suspect or defendant on bail pending trial and place him under residential surveillance under any of the following circumstances: (1) He may be sentenced to public surveillance, criminal detention or independently apply supplementary punishment; (two) may be sentenced to more than fixed-term imprisonment, bail pending trial, residential surveillance will not cause social danger. Bail pending trial and residential surveillance shall be carried out by public security organs. "