Cambodian self-exiled opposition chief has resigned from the party leadership in apparent response to plans by the country's long-serving prime minister for a law that could lead to the party's dissolution.

Sam Rainsy, 67, announced his decision on Saturday in a letter to senior members of his Cambodia National Rescue Party (CNRP) that was published on social media, saying he was standing aside "for the sake of the party".

"In all circumstances, I cherish and uphold the CNRP's ideals in my heart," wrote Rainsy who has led the party since its creation in 2012.

He has not visited Cambodia since 2015, when he fled to France to avoid a two-year jail term for defamation, which his supporters say was politically motivated.

Defamation lawsuit

In December, a Phnom Penh court handed him a five-year prison sentence over a post on his Facebook page - a conviction that made any imminent return from exile even more unlikely.

Hun Sen, Cambodia's prime minister, also lodged a one-million-dollar defamation lawsuit against Rainsy last month and threatened to seize the CNRP's headquarters if he wins the case.

Rainsy's resignation came shortly after Hun Sen proposed amending political party laws to bar convicts from leadership positions.

READ MORE: Cambodian court orders arrest of opposition leader

The sudden resignation casts doubt over a party that poses the only viable challenge to Hun Sen's 32-year rule in a general poll scheduled for 2018.

Kem Sokha, Rainsy's deputy, who has been serving as acting leader, is expected to guide the party as it prepares for local commune elections in June.

Although nominally a democracy, Cambodia has been ruled for more than three decades by Hun Sen, who has amassed extensive control over the government, armed forces and economy.

Ever since he nearly lost his office to the CNRP in 2013, rights groups say Hun Sen has been bent on dismantling the opposition, using pliant courts to target his rivals and other critics.

Hun Sen claims to have brought much-needed peace and stability to an impoverished nation ravaged by decades of civil war and the Khmer Rouge government.

But opposition groups have drawn growing support in recent years amid disillusionment with the endemic corruption and rights abuses that have flourished under his watch.