A bench headed by Justice L. Nageswara Rao invoked extraordinary powers to grant relief to A.G. Perarivalan, 50, who was already granted parole in March.
Perarivalan was convicted for supplying batteries used in a bomb that killed Gandhi in the southern state of Tamil Nadu on May 21, 1991.
The bombing was carried out by the Liberation Tigers of Tamil Eelam (LTTE), a Sri Lankan armed separatist group.
Gandhi's killing by a suicide bomber was seen as retaliation for a 1987 Indian government pact with Sri Lanka to disarm the Tamil guerrillas.
India later withdrew troops deployed to the island country after losing 1,200 of them at the hands of the rebels.
Perarivalan, who was arrested in 1991 and was 19 at the time of the assassination, was first sentenced to death, but later had his punishment commuted to a life sentence.
His case was mired in legal wranglings since he filed a mercy petition in 2015 between the state and the central government.
Tamil Nadu's governor passed the decision on the plea to India's president, but the Supreme Court ruled that this did not have "constitutional value" and invoked special powers to order Perarivalan's release.
Six others are still in jail serving life sentences in the case.
Rajiv Gandhi became India's youngest-ever leader after his mother, Prime Minister Indira Gandhi, was assassinated in October 1984. He ruled until losing an election five years later.