The apex court noted the "perversity in conducting this case at various stages, right from the investigation level to the granting of sanction by the state government to prosecute the accused persons under Prevention of Terrorism Act (POTA), the conviction and awarding of sentence to the accused persons by the Special Court (POTA) and confirmation of the same by the High Court".
"We, being the apex court, cannot afford to sit with folded hands when such gross violation of fundamental rights and basic human rights of the citizens of this country is presented before us," a bench comprising Justices AK Patnaik and V Gopala Gowda said.
"Before parting with the judgement, we intend to express our anguish at the incompetence with which the (probe) agencies conducted the investigation into the case of such a grievous nature, involving the integrity and security of the nation.
"Instead of booking the real culprits responsible for taking so many precious lives, the police caught innocent people and got grievous charges imposed against them which resulted in their conviction and subsequent sentencing," the bench said.
The "circumstance, looming large in the background inevitably leads to the conclusion that the prosecution story was conceived and constructed after a good deal of deliberation and delay in a shady setting, highly redolent of doubt and suspicion," It added.
Besides the three who were facing the gallows, the apex court also quashed the life sentence of two others and the 10- year jail term of another person for the September 24, 2002, terrorist attack on the Akshardham temple in Gandhinagar.
The bench said that "the appellants who are in custody shall be set at liberty forthwith, if they are not required in any other criminal case" and added that it was also setting aside the conviction of another accused, who did not file an appeal and has already undergone the sentence served on him.
Adam Ajmeri, Shan Miya alias Chand Khan and Mufti Abdul Qyyum Mansuri were awarded the death sentence in July, 2006, by the special court set up to try the case under POTA.
While a local youth from Dariapur in the city, Mohammed Salim Shaikh, was sentenced to life imprisonment, Abdulmiyan Qadri was given a 10-year term with Altaf Hussain being sentenced to five years in jail.
Two militants, identified as Murtuza Hafiz Yasin and Ashraf Ali Mohammed Farooq, with alleged links with Pakistan- based outfit Lashkar-e-Taiba, were killed by National Security Guard (NSG) commandos during the attack on the temple.
The attackers, using automatic weapons and hand grenades, killed 32 people, including 28 visitors, three commandos, one of them from NSG, and a constable of the State Reserve Police.
Delivering its 281-page judgement, the bench said, "According to us, this is a fit case for interference by this court under Article 136 of the Constitution as we are of the firm view that the concurrent findings of the Special Court (POTA) and the High Court are not only erroneous in fact but also suffer from error in law".
"The present case does not show that the sanctioning authority had applied its mind to the satisfaction as to whether granting of sanction (was needed).
"The prosecution had failed to prove that the sanction was granted by the government either on the basis of an informed decision or on the basis of an independent analysis of fact on consultation with the Investigating Officer.
"This would go to show clear non-application of mind by the Home Minister in granting sanction. Therefore, the sanction is void on the ground of non-application of mind and is not a legal and valid sanction under Section 50 of POTA," the bench said.
The bench said it was of the "opinion that neither the police officer recording the confessional statements nor the CJM followed the statutory mandates laid down in POTA under Sections 32 and 52 while recording the confessional statements of the accused persons".
"We hold that the confessional statements made by accused under Section 32 of POTA are not admissible in law in the present case," it said.
The bench also found fault with Gujarat Police in making one of the accused an approver saying the evidence of the accomplices cannot be used to corroborate the confessional statements of the accused in the absence of independent evidence. Furthermore, the delay of more than one year in recording their statements causes the court to disregard their evidence, it added.
It also said that there were a lot of discrepancies in the theory of the letters written in Urdu found from the pockets of the slain Fidayeen terrorists, which cannot be taken as evidence in order to implicate the accused persons in the case.
The apex court also expressed its disinclination to give any weightage to the 'panchnama' drawn by Gujarat Police in Jammu and Kashmir for seizure of a car from Bareilly in Uttar Pradesh which was allegedly used to carry the weapons for the attack on Akshardham temple.
Further, the bench said "there is no independent evidence on record which corroborates the confessions of the accused persons which were subsequently retracted.
"We hold that there is no independent evidence on record to prove the guilt of the accused persons beyond reasonable doubt in the face of the retractions and grave allegations of torture and violation of human rights of the accused persons."