The Sri Lankan president's party won 22 out of 23 local councils in elections, results showed Sunday, as police investigated a gun battle in which three people were killed.

Two factions within the national ruling alliance clashed shortly before polling closed on Saturday, leaving a presidential aide and two of his bodyguards dead and more than a dozen people seriously wounded.

Police said at least two officers were among those critically hurt in the shoot-out in the Kolonnawa electorate within the district of Colombo.

Official poll results showed that President Mahinda Rajapakse's United People's Freedom Alliance swept the polls, but lost the most prestigious Colombo Municipal Council.

The fractured opposition faced a rout elsewhere, with Rajapakse's party gaining large majorities in provincial towns.

At the site of the shoot-out, a curfew was lifted Sunday, but police commandos and soldiers remained on the street to maintain law and order, a police spokesman said.

Presidential adviser Bharatha Lakshman Premachandra, 55, died of gun shot wounds along with two of his bodyguards when a rival faction within the ruling alliance opened fire minutes before polling ended.

Premachandra's arch rival, legislator Duminda Silva, was also wounded in the confrontation and was in intensive care Sunday after surgery to remove two bullets from his brain, hospital sources said.

The shooting has seriously embarrassed the government, which is yet to comment on the violence.

Saturday's poll, in which 1.5 million people were eligible to vote, was seen as a mid-term test for Rajapakse, who won a second term for himself and his party in elections last year.

Rajapakse has boosted his popularity and tightened his grip on power since government forces crushed Tamil Tiger rebels in 2009 and declared an end to nearly four decades of ethnic conflict which had claimed up to 100,000 lives.