Those affected say the ban is politically motivated
The Venezuelan Supreme Court has ruled that a ban on some 270 people from standing in November's state and municipal polls is constitutional.
The list of barred candidates was issued by Venezuela's anti-corruption chief, Clodosbaldo Russian.
He said the law gave him the right to impose restrictions on potential candidates suspected of corruption.
Critics said the ban was unconstitutional because none of those affected had been convicted of a crime.
Mr Russian, Venezuela's comptroller general, issued his list of barred candidates earlier this year.
He argued that under Venezuelan law he had the right to disqualify people suspected of corruption from running for office.
His view was upheld by the Supreme Court (TSJ), which ruled on Tuesday that a contested article of law that enabled the ban did not violate the constitution.
The opposition say the disqualification is politically motivated and affects key opponents of President Hugo Chavez.
These include Leopoldo Lopez, the mayor of the Caracas neighbourhood of Chacao, who had planned to stand as mayor of the capital.
Those affected argued that the ban was in violation of the constitution, which protects the political rights of all citizens unless they have been convicted of a crime.
Mr Russian has rejected this, saying the disqualification of potential candidates did not remove all their political rights but "solely the possibility of running for political office".
The elections on 23 November for state governors, mayors and councillors are being seen as a critical test of President Hugo Chavez and his political project.
Last December, Mr Chavez lost a referendum on a raft of reforms, including one that would allow him to run again in the 2012 presidential election.
His allies run most of Venezuela's states and cities, and analysts say he needs electoral success in November to build momentum for further attempts to reform the constitution