The opposition legislature voted on Tuesday to get the country back into the so-called Rio Pact that would allow it to request foreign military help.
"The Constitutional Chamber of the Supreme Court in Ruling 248 declared the absolute nullity and lack of legal effect of the decree", Justice Juan Jose Mendoza said.
Venezuela and three other South American countries exited the 1947 Inter-American Treaty of Reciprocal Assistance more than a decade ago.
The opposition has been trying to oust the government of President Nicolas Maduro with the help of the United States. Washington has backed opposition leader Juan Guaido and imposed sanctions that US officials said were designed to exacerbate the country’s already acute economic crisis.