Sam Rainsy, the co-founder of the banned Cambodia National Rescue Party with Kem Sokha, arrived in Malaysia on Saturday on a well-publicized trip to lead a movement to oust long-serving authoritarian Prime Minister Hun Sen.
Sam Rainsy missed his self-declared deadline of returning on Saturday, Cambodian Independence Day, and his further plans are not clear.
He had been barred from entering Cambodia, but Deputy Prime Minister Sar Kheng said Saturday in a Facebook post that he was now welcome to return but would have to face justice in several concluded and pending legal cases.
While Kem Sokha and Sam Rainsy are political partners, they are also rivals and there are bad feelings between their respective supporters because of Kem Sokha's willingness to stay in Cambodia while Sam Rainsy has been in self-imposed exile since 2015.
Kem Sohka is still barred from engaging in political activity, but his newfound freedom raises his profile as an alternative leader to Sam Rainsy.
Hun Sen, known over almost 35 years in power as a wily and ruthless politician, has a history of employing divide-and-rule tactics against his opponents.
Sunday's court order keeps several restrictions on Kem Sokha. He is not allowed to travel outside Cambodia or get involved in political activity, and he must comply and cooperate with the court or the authorities.
The court declared it acted after his lawyers said he needed medical care.
Kem Sokha faced an intense campaign of harassment in 2015, culminating with his arrest in September that year on a charge of treason. The main evidence against him were videos several years old that showed him at a seminar where he spoke about receiving advice from U.S. pro-democracy groups.
Even though his case has not yet gone to trial, he has been under house arrest, with his outside contacts tightly restricted.
His arrest was part of a wide-ranging crackdown by Hun Sen and his ruling Cambodian People's Party in late 2017, which saw all critical media voices silenced in addition to the country's high court dissolving the Cambodia National Rescue Party.
The party's dissolution was seen as a political ploy to ensure victory by Hun Sen's party in the 2018 general election by eliminating the only credible opposition group. The Cambodia National Rescue Party had mounted an unexpectedly strong challenge in the 2013 election.
Kem Sokha's daughter as well as his lawyer expressed disappointment that he was not freed unconditionally.
"We still continue to call for the dropping of all charges and reinstatement of his political rights," the U.S.-based daughter, Kem Monovithya, wrote on Twitter.
His lawyer, Pheng Heng, told The Associated Press that Kem Sokha has a serious back problem that needs treatment by a specialist and possibly surgery.
Rights activists described the court's order as a hollow gesture, meant to ease criticism as the European Union prepares to decide on whether to withdraw preferential duty-free and quota-free status for imports from Cambodia because of its deficiencies on labor and human rights.
Cambodia is one of a number of developing nations with whom the EU has an "Everything But Arms" — or EBA — program granting preferential access to the European market for products other than weapons.
"Kem Sokha's release from house detention is a last minute attempt to deflect European anger at the shoddy way PM Hun Sen and Cambodia have dealt with human rights concerns raised in the EBA process," said Phil Robertson, deputy director for Asia of Human Rights Watch.
Sam Rainsy's next moves remain unclear.
He has been Hun Sen's most prominent foe for decades. He went into exile in late 2015 to avoid a two-year prison sentence on charges of criminal defamation. Other legal cases have since been lodged against him by the government.