Two security officials were arrested in a dramatic early-morning operation and barred from meeting their lawyers as a court extends their detention.