Detective in custody following SWAT standoff