Pakistan's Supreme Court has demanded the government explain its decision to send troops into the controversial Red Mosque in Islamabad last month.
More than 100 people were killed when security forces stormed the mosque to flush out Islamic militants.
The attack marked the end of an eight-day siege after vigilante attacks by mosque students seeking to impose Islamic Shariah law in the capital.
Since the operation attacks on the security forces have soared.
Judge Javed Iqbal ordered the interior ministry and other government departments to provide answers about the siege and storming of the mosque.
"The legality of the operation needs to be explained," he said.
The court also heard a petition filed by the national association of seminaries (madrassas), which says it wants to establish who was responsible for casualties during the siege and raid on the mosque.
The association has put forward 25 questions it wants answered.
These include whether an agreement was reached with the deputy head of the mosque, Abdul Rashid Ghazi, and, if so, why was it thrown aside.
Judge Iqbal ordered the government to submit comprehensive answers to all the questions.
Security forces raided the mosque and its attached Jamia Hafsa seminary on 10 July.
Officials say about 100 people were killed during the raid. These include women and children who were inside the mosque at the time.
But media reports and right-wing groups have suggested the figure was actually much higher.
"We intend to file murder cases against officials including President Musharraf," a lawyer for the petitioners, Iftikhar Gillani, said in court.
"They are all responsible for the bloodbath in the Red Mosque."
The Supreme Court has given the government four weeks to submit a detailed reply on the matter.
Bail
Meanwhile, the government has released all but one of the remaining detainees held during the mosque operation.
The only exception is Maulana Abdul Aziz, the head of the mosque, who is still in custody. He was arrested while trying to flee the complex dressed in a burka.
On Monday, 19 seminary students along with Maulana Aziz's daughter and wife were granted bail.
In addition, Khalid Khawaja, an ex-secret services official and now a human rights activist who is also charged in the case, was granted bail and freed.
Source: BBC