A.P. court grants police custody of six in terror case