PHNOM PENH (Reuters) - Cambodian Prime Minister Hun Sen, whose critics accuse him of undermining democracy, on Monday hailed the results of local elections as a sign he would win next year’s general election to extend more than three decades in power.

Slideshow ( 5 images )

But although the main opposition party fell short of its hopes in Sunday’s ballot, it increased its share of the vote and promised a hard-fought contest in 2018.

The Southeast Asian country has grown increasingly tense in the run-up to the elections and Hun Sen’s opponents complained of having to counter threats, court cases and the detention of politicians and activists.

The opposition Cambodia National Rescue Party (CNRP) won about 46 percent of votes in Sunday’s vote compared with more than 51 percent for Hun Sen’s ruling Cambodian People’s Party (CPP), according to unofficial results from both parties.

It was a big gain for the opposition over its showing in the last local elections, but it had hoped for 60 percent in the ballot for 1,600 communes.

“It is already clear the ruling party will remain a majority party in the National Assembly and continue to lead the government ahead,” Hun Sen wrote in a post on social media site Facebook, beside pictures of himself playing golf and posing in sunglasses.

Hun Sen, 64, one of Asia’s longest serving rulers, has been prime minister for 32 years. His growing friendship with Beijing has brought infrastructure loans that have made Cambodia less reliant on Western donors who express concerns about democracy.

The prime minister has repeatedly warned of violence if his party does not keep power, raising deep concerns in a country where about 1.8 million people died of starvation, violence, exhaustion or disease under the communist Khmer Rouge regime in the 1970s.

Voting went smoothly on Sunday and observers recorded little malpractice or intimidation.

The opposition said it was still pleased with its results. The ruling party won control of 97 percent of Cambodia’s communes in the 2012 election, when opposition parties were divided.

“These results are the basis that may prove that we will win the general 2018 election,” said CNRP leader Kem Sokha, whose exiled predecessor resigned in February, saying he feared the party would be banned if he did not.

The opposition did much better than expected in the last general election in 2013, leaving the ruling party with only a small majority in parliament.

“The momentum has always been on the opposition side,” said Ou Virak of the Future Forum think-tank.

“Given that the 2018 election is the most important election, I think the opposition will be stronger and that makes the outcome of the next election pretty unpredictable.”

The National Election Committee is due to publish official results on June 25.

Sunday’s voting was orderly and peaceful, the U.S. embassy said, but added that it expected the election body to “investigate fully the concerns expressed by opposition parties and civil society organizations before and during the campaign”.