PHNOM PENH, Cambodia — The embattled leader of Cambodia’s main opposition party abruptly quit on Saturday in the face of increasing government pressure, ceding a political stage he had occupied for more than two decades.

The resignation of the leader, Sam Rainsy, came after the government began a series of moves that would allow it to dissolve the Cambodia National Rescue Party he led, in advance of crucial local elections set for June. The opposition has also been hit with a barrage of lawsuits and leaked telephone conversations between leading figures and women purported to be their mistresses.

It was unclear whether Mr. Sam Rainsy, 67, was leaving politics for good or was planning to work quietly behind the scenes. Either way, his exit seemed to represent the end of an era.

As the head of three liberal-leaning political parties since 1995, he had been a thorn in the side of the country’s long-ruling prime minister, Hun Sen, for more than 20 years.