The Venezuelan National Assembly has passed an amnesty bill which could free dozens of jailed opposition leaders.
The opposition-controlled assembly passed the bill after a heated discussion late on Tuesday.
President Nicolas Maduro said he would block the bill, which he argued would benefit "criminals and terrorists".
The opposition won the parliamentary elections in December on a promise to work towards the release of dozens of what it considers political prisoners.
Among the more than 70 detainees who could be freed if the bill becomes law 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.
The prosecutor in the case later fled Venezuela and told media abroad that Mr Lopez's conviction had been a political show trial.
But government officials maintain Mr Lopez is responsible for the violence which erupted during the 2014 protests in which 43 people on both sides of the political divide were killed.
Mr Lopez's wife, Lilian Tintori, welcomed the passing of the bill, saying it was "felt in all of Venezuela, like a fireworks rocket going off in Caracas, full of emotion, freedom and strength".
"Today, with this amnesty law, we're taking a major step towards the rescue of democracy and liberty," she said.
"We're going to free not just the political prisoners but the whole of Venezuela," she added.
Other political leaders who could be freed are the former mayor of Caracas, Antonio Ledezma, who is under house arrest, and the former mayor of San Cristobal, Daniel Ceballos.
But members of the governing PSUV party said the amnesty was a carte blanche for "murderers".
President Maduro spoke on national television while the debate was still under way to say he would veto it.
"You can be certain that that law will not be making it through here," he said.
Legal battle ahead
Under the Venezuelan constitution, the president can send a bill back to the National Assembly, but the latter can override the veto with an absolute majority (half of those present at the time of the vote plus one).
President Maduro could also send the bill to the Supreme Court if he has doubts about its constitutionality.
Critics of the government say the top court is stacked with supporters of the president and could therefore pose a serious threat to the bill becoming law.
Socialist lawmakers backed President Maduro in his rejection of the bill.
"There's going to be justice here and everyone who is in jail for corruption, for murder or for violating the constitution or the law will stay locked up," Dario Vivas said.
Venezuela is deeply divided into those who support the socialist government of Nicolas Maduro and those who oppose it.
Last month, the opposition announced it would try to drive President Maduro from power by means of a recall referendum or a constitutional amendment to shorten his term.
The government denounced the plans as an attempted coup.