About 70 activists opposed to President Nicolas Maduro´s socialist government had been due for release under the law approved last month, but the Supreme Court declared the amnesty law unconstitutional.
In a statement, the court said the amnesty law was unconstitutional because it covered offences "that are acts of organized crime, which are not related to crimes of a political nature".
The court has consistently backed the Venezuelan government since the opposition triumphed in congressional elections in December. President Maduro had condemned the law as an attempt to destabilize his leadership of the country.
The opposition won parliamentary elections largely on a promise to work towards the release of dozens of what it considers political prisoners.
Among the detainees is Leopoldo Lopez, a prominent opposition leader who was sentenced to 13 years and nine months in prison last year for inciting violence during mass protests in which 43 people killed in 2014.
The prosecutor in the case later fled Venezuela and told media abroad that Mr Lopez´s conviction had been a political show trial.
Other political leaders who were set to be freed include the former Caracas Mayor Antonio Ledezma, who is under house arrest, and the former mayor of San Cristobal, Daniel Ceballos.
Members of the governing PSUV party had said the amnesty was a carte blanche for "murderers".President Maduro had the choice of signing the law, sending it back to the National Assembly or challenging it before the Supreme Court. Last week, he told supporters that he had decided to ask the court to invalidate the "criminal" bill.
After the Supreme Court´s ruling, he said he would set up a truth commission to deal with jailed opposition activists´ cases and that opposition members would be invited to join.
Critics of the government say the top court is stacked with supporters of the president.Venezuela is deeply divided into those who support the socialist government of Nicolas Maduro and those who oppose it.