Police say they were planning a killing spree which could have been “the UK’s deadliest terror attack”.