Both were sent back to prison from house arrest for allegedly seeking to escape and not complying with conditions forbidding political activity, according to the Supreme Court.
Lopez and Ledezma had called on the electorate to boycott Sunday’s vote, which they denounced as an unlawful power grab.
Leader of the radical wing of the opposition that believes in the necessity of street action, the 46-year-old economist was educated at Harvard.
He became one of the icons of the anti-Chavista movement (named after those opposed to the country’s late leader Hugo Chavez) following his arrest in February 2014 when he was sentenced to 13 years in prison on charges of inciting violence during protests that led to 43 deaths.
Photogenic and with an easy smile, the former mayor of the upscale Chacao district of the capital notably called for the protests that briefly ousted Chavez from power in April 2002.
His tangles with the government led to him being barred from contesting elections twice, including the presidential vote of 2012.
Married to former TV presenter Lilian Tintori, who herself has become a senior figure in the opposition, the father-of-two is also known for his ambition and taste for confrontation.
After three and a half years behind bars, he was sent to serve the remainder of his sentence at home on July 8 on medical grounds.
The mayor of Caracas, who is also a lawyer, was arrested and jailed in February 2015 after being accused of conspiring against the president and associating with criminals.
The balding, bespectacled 62-year-old was sent home in April to serve the remainder of his sentence under house arrest following surgery.
Ledezma is a veteran of the social democrat Democratic Action party, the country’s most powerful political force until Chavez came to power in 1999.
He was a member of parliament (1984-1992), a governor (1992-1993), senator (1994-1996) and mayor for a district of Caracas (1996-2000).
Elected mayor of the capital in 2009 and re-elected in 2013, he was brutally arrested in 2015 in his offices by several dozen armed intelligence agents wearing balaclavas and bullet-proof vests.
The prosecutor’s office demanded that he be sentenced to 16 years in prison for his alleged support of groups deemed to want to violently destabilize the country. He is married with three children.