Pakistan has for the first time admitted that it is holding about 700 suspected militants without trial.
Attorney General Irfan Qadir said the prisoners were in internment centres in the tribal belt near the Afghan border.
He said a "war-like situation" existed in the area and they would remain in custody while operations continued.
The admission came during a Supreme Court hearing about seven suspects who were freed from jail in 2010 but later seized by intelligence agents.
Analysts say the case of the men - known as the Adiala Seven - is a challenge to the assumption that Pakistan's feared ISI intelligence agency can operate independently of the law.
The men appeared in court last year, in very poor health, when the ISI was forced to produce them. Four other suspects detained with them died in custody.
It is unclear how long the hundreds of militant suspects Mr Qadir referred to have been held and he gave no time frame for their release. He added only that the authorities would decide if they could be put on trial.
"There is a military operation in Waziristan. Under the law we cannot try these 700 people, nor can we release them, unless the operation is over," Mr Qadir said.
But Pakistan's Chief Justice Iftikhar Muhammad Chaudhry said that the human rights of the seven men whose case is being heard were being violated and that they should be tried.
"We don't want them to be released if they are criminals or militants," Mr Chaudhry told Mr Qadir.
"They should be tried under law, and you cannot keep them in custody illegally."
The court ordered officials to produce a detailed report about the evidence against each suspect.
Human rights group Amnesty International accused Pakistan in December of arbitrarily detaining thousands of men and boys, many of whom alleged they were tortured.
But the army rejected The Hands of Cruelty report as a "pack of lies".