Lopez has been detained since early 2014 over accusations of inciting anti-government protests.
“By the power of Supreme Court Judge Maikel Moreno, the criminal court of the Supreme Court Justice grants house arrest to Leopoldo Lopez due to health problems,” the court tweeted.
One of Lopez’s relatives confirmed that he has been granted house arrest. Details about his physical condition weren’t immediately available.
Lopez’s supporters rejoiced on Saturday morning.
“This must be an advancement towards full-fledged freedom,” fellow Venezuelan opposition leader and National Assembly representative Henry Ramos Allup said on Twitter.
Lopez’s wife, Lilian Tintori, tweeted that she had been able to see him for an hour.
Spanish Prime Minister Mariano Rajoy, who has advocated for the release of Venezuelan political prisoners, posted on Twitter that he was “happy that @LeopoldoLopez has come home to @LilianTintori and their children.”
Arrested in 2014
Lopez, a former mayor of a Caracas district with ambitions for the presidency, has long been a vocal opponent of the socialists in power and was banned in 2008 from running for office on accusations of corruption.
Lopez described the banning as political retribution. An international human rights court cleared him in 2011, but the country’s Supreme Court upheld the ban.
In February 2014, after at least three people were killed during an anti-government protest in the capital, authorities blamed him for the violence. He turned himself in, and was sentenced in 2015 to nearly 14 years in prison.
This spring, he appeared on video to dispel health rumors after a journalist had tweeted that he’d been sent to a hospital. Lopez in May appeared on state television in a white tank top with prison bars behind him, citing the date and time in what he said was a “proof of life” message.
Public pressure against the government increased earlier this year, when all powers of the opposition-led National Assembly were transferred to the Supreme Court, which is stacked with government loyalists. Amid widespread criticism, the court revoked that ruling in April.
Anti-government protesters have taken to Caracas’ streets over the past several months. Maduro has sent the Venezuelan military onto the streets to maintain order, leading to deadly clashes. More than 85 people have died in the unrest.
Demonstrators have called for Maduro to step down, accusing him of eroding democracy.
Also spurring protesters: Unemployment is set to surpass 25% this year. Soaring inflation and widespread shortages of medicine, food and other essentials have also plagued the country.
Some Venezuelans have opted to leave the country, crossing the border into Colombia after enduring months without basics such as milk, eggs, flour, soap and toilet paper.
The government has been accused of intimidating and restricting the media, including taking CNN en Espanol off the air. It tightly controls visas for foreign journalists including CNN, arresting those who report from inside the country without proper permits.
CNN’s Julia Jones, Faith Karimi and Ray Sanchez contributed to this report.