COLOMBO - Sri Lankan President Mahinda Rajapaksa won re-election on Wednesday in an historic post-war vote but his chief rival called for the results to be nullified after soldiers surrounded him in a luxury hotel.

Official results showed Rajapaksa winning 57.8 percent of 10.4 million votes cast against 40.2 percent for former army commander General Sarath Fonseka, Elections Commissioner Dayananda Dissanayake said.

Fonseka and Rajapaksa as allies in war laid claim to the total defeat of the Liberation Tigers of Tamil Eelam (LTTE) but became rivals in a close-fought, bloody campaign that culminated in a relatively peaceful election on Tuesday with heavy turnout.

I announce that Mahinda Rajapaksa has won this presidential election, commissioner Dissanayake told reporters. There was no question Rajapaksa had won more than the required 50 percent plus one vote to secure another six-year term.

Soon after, Fonseka told reporters he had asked Dissanayake to nullify the vote, alleging vote-rigging.

We ask him to declare null and void the results. We have asked him not to release the results as we are going to go to the courts, he told reporters. Our strength is people and their franchise has been disregarded.

Dissanayake said there were three areas in which vote counters had been assaulted by political operatives but declined to say which camp was responsible.

Rajapaksa has said he wants a new mandate to bless his plans to develop Sri Lanka by exploiting its geographically strategic position astride air and sea lanes, rebuilding infrastructure and encouraging foreign investment and local productivity.

GRENADE ATTACK

Hours before Rajapaksa was declared the winner, two people were killed and four wounded in a grenade attack on a Buddhist temple in the central town of Gampola, military spokesman Brigadier Udaya Nanayakkara said.

It was not immediately clear if the blast was poll-related, he said.

Tension was high early on Wednesday as troops surrounded Fonseka in the Cinnamon Lakeside hotel in the capital Colombo, recently renovated to take advantage of increasing tourist arrivals on the Indian Ocean island since the war's end.

These people have surrounded the hotel with military and threatened my security people, Fonseka told Reuters by phone.

Nanayakkara, the military spokesman, said there were no plans to arrest Fonseka but rather to capture around 400 army deserters with him who could pose a potential coup risk.

They have booked 100 rooms. They are highly trained military people. We are suspicious about their gathering. General Fonseka has released nine deserters to the military police, he said.

Fonseka later said they were part of his security detail.

If Udaya Nanayakkara says there are 400 people in this hotel, he must be off his nuts. They want to remove all my security, he said.

Fonseka quit the army in November and entered the race with the backing of a motley coalition of political parties united solely to beat Rajapaksa, after he said he was sidelined and suspected of plotting a coup.

The political neophyte delivered an election day shock when he admitted that he had not registered to vote, prompting the government to cry foul over an electoral commission ruling that he was still qualified to stand for election.

Independent observers put overall turnout at between 70 and 80 percent of the 14 million registered voters, although votes in predominantly Tamil areas registered much lower turnout. Fonseka was forecast to lead in those areas.

Rajapaksa called the poll two years early, hoping to capitalize on his post-war popularity to win a second term and cement his legacy.

Fonseka as army commander ran a relentless counterinsurgency campaign to crush the Tigers, while Rajapaksa deflected an international push for a ceasefire and criticism over civilian deaths that prompted calls for a war crimes probe.

Rajapaksa will hold on to the reins of a $40 billion economy which has enjoyed a partial peace dividend, and is on the path to recovery with big Chinese and Indian investments into infrastructure and plans to put $4 billion into development.

Foreign investors have put more than $1.5 billion into government securities, and the Colombo Stock Exchange, turned in one of 2009's best returns at 125 percent.

(Editing by Paul Tait)