Venezuelan opposition leader Leopoldo Lopez has been released from prison and placed under house arrest after more than three years behind bars.

The unexpected move fuelled hopes for a broader amnesty for dozens of jailed activists as the country slides deeper into political turmoil.

Venezuela’s government-stacked Supreme Court said it had granted Mr Lopez the “humanitarian measures” for health reasons and “serious signs of irregularities” in the handling of the case.

Leopoldo Lopez salutes supporters outside his home (Ariana Cubillos/AP)Leopoldo Lopez salutes supporters outside his home (Ariana Cubillos/AP)

A euphoric Mr Lopez briefly greeted a few dozen supporters gathered outside his home in Caracas.

Climbing on top of a wall dressed in a white shirt, he kissed a Venezuelan flag and raised his right fist in a show of defiance.

Mr Lopez vowed that he is prepared to return to jail rather than give up his fight to remove President Nicolas Maduro.

“This is a step in the march toward freedom,” Mr Lopez said in a statement read by close ally Freddy Guevara. “I carry no resentment, nor will I give up my beliefs. My position against this regime is firm as are my convictions to fight for a real peace, coexistence, change and freedom.”

Antonieta Mendoza, the mother of Leopoldo Lopez, speaks to the media. (AP)Antonieta Mendoza, the mother of Leopoldo Lopez, speaks to the media. (AP)

As his backers celebrated, relatives of dozens of other jailed activists gathered at a Caracas jail in the hope that their loved ones might also be released in the coming hours.

Speculation that Mr Lopez’s transfer may have been part of a larger deal was sparked in part by a government truth commission statement saying that as part of its work to defuse tensions, it had asked the judicial system to evaluate applying “alternative formulas” for those imprisoned for violent acts.

The opposition has been demanding the release of dozens of activists it consider political prisoners in order to initiate talks aimed at resolving a political crisis that has left more than 90 people dead and hundreds injured.

Supporters cheer for Leopoldo Lopez in Caracas (Fernando Llano/AP)Supporters cheer for Leopoldo Lopez in Caracas (Fernando Llano/AP)

Mr Lopez, the most prominent and defiant of those behind bars, was seen as the last person likely to leave jail in the event of any government concessions.

The 46-year-old former Caracas-area mayor was sentenced in 2015 to nearly 14 years in prison for inciting violence during anti-government protests in which three people died and dozens were wounded.

Venezuela has been rocked by months of near-daily protests again this year, fuelled by widespread discontent over shortages of basic goods, galloping inflation and allegations that Mr Maduro is undermining democracy in the country.