The courts have increasingly challenged both the civilian government and the powerful military since Chief Justice Iftikhar Chaudhry led street protests that toppled army leader Pervez Musharraf in 2008.
Human rights lawyers and relatives of hundreds of missing prisoners have been fighting for years to get information about the detainees, a few of whom had links to radical mosques. Some disappeared from jail; others were picked up by security forces and never seen again.
Most have not appeared in court charged with a crime, while others were acquitted but seized after they were freed.
Security agencies complain that Pakistan's criminal courts, which have an overall conviction rate of between five and ten per cent, simply release militant suspects. Police investigations are notoriously poor and judges subject to intimidation.
This latest case was brought to the Supreme Court by relatives of 35 prisoners who have not heard from them since they were handed over to the army by the head of Malakand jail in 2012. There were no official orders and it is unclear why the prisoners were handed over to the military.
The court ruled on Friday the army must produce these men to show they were still alive. On Saturday 14 men with scarves across their faces were led from a van with blackened windows into the judges' chambers, which were closed to the press.
Court documents showed that the men included some of the 35 prisoners. However court officials said some were prisoners and some their relatives who could identify them. They refused to specify how many of the 14 were prisoners.
More prisoners might be produced after the weekend, said Maj. Gen. Arif Nazir, acting secretary of defence. "We have complied with the court's orders as much as we could today, we will try to comply with the remaining orders on Monday," he said.
The prisoners will be returned to detention, but the partial compliance with the court ruling was a rare concession from the military, which has ruled the country for more than half of its history.
The case of the 35 detainees fits a wider pattern where prisoners go missing in custody, said Amina Janjua, the lawyer for hundreds of missing families and the husband of a prisoner missing for eight years.
She said she had received 235 cases of missing people in the past two months alone, mostly from Swat Valley, a mountainous area which is a few hours drive from the capital.
Before the Supreme Court hearing on Saturday, families camped in the capital Islamabad with pictures and posters showing their missing relatives.
Since 2008, the Supreme Court has heard several complaints over the cases of the missing prisoners, but the military has usually refused to produce them.
The only other time prisoners have appeared was last year. Seven men were produced out of a group of 11 that were taken from Adiala jail in 2010. They were so malnourished and badly injured they could barely walk, Janjua said. The other four men had died in custody, she said.
Supreme Court Chief Justice Chaudhry, whose involvement in the missing persons cases has placed the military and its intelligence agency under unprecedented scrutiny, is due to retire on December 12.
It is unclear if his successor will pursue such cases with the same vigour, said Janjua.
Get Breaking news, live coverage, and Latest News from India and around the world on NDTV.com. Catch all the Live TV action on NDTV 24x7 and NDTV India. Like us on Facebook or follow us on Twitter and Instagram for latest news and live news updates.