The Delhi High Court, hearing a plea against the death sentences handed down by a special court to three men last December, upheld the sentences on Muhammad Afzal and Shaukat Husyan Guru.
Both men were said to be affiliated to the Jaish Muhammad group battling Indian occupation in Kashmir.
However, the court acquitted a third man who had been given the death penalty, SAR Gilani, a college lecturer, as well as Husyan's wife, Afsan Guru, who was sentenced to five years imprisonment for concealing the conspiracy to attack the parliament.
In December, a special 'anti-terrorism' court had found the three men guilty of waging war against the state of India by conspiring with five Kashmir resistance fighters to kill senior political leaders inside parliament.
The sentences were announced under the provisions of the tough Prevention of Terrorism Act (POTA), the Indian Penal Code and Explosive Substances Act. The judgement was the first under POTA.
In the 13 December 2001 attack, five armed rebels stormed the parliament grounds, killing 8 police officers and a gardener before they were shot dead by Indian security forces.
A journalist wounded in the attack died months later of his wounds.
The four accused had challenged their convictions, as the Delhi High Court last year had questioned the use of transcripts of taped telephone conversations as evidence in the 'anti-terrorism' court.
The Delhi court had then said the transcripts could not be used in the case, as police had failed to follow the procedures laid down under POTA for tapping phones.
The transcripts formed the basis of the case made out by the prosecution against the four accused.
In allowing the appeal of Gilani and Afsan Guru, the Delhi High Court on Wednesday said "prosecution has not been able to sustain the charges against them", the Press Trust of India (PTI) news agency reported.
The last time an accused is known to have been executed in India, was in the case related to Indira Gandhi's murder in 1984
Afzal's counsel requested the high court to stay his execution, but the judges ruled that as the jail authorities were not going to carry out execution orders immediately, the defence had "enough time to file an appeal".
The last time an accused is known to have been executed in India was in the case related to prime minister Indira Gandhi's murder in 1984, for which two people were executed.