* President wins re-election against ex-military rival
* "We will attract investment, fight corruption" - Koroma
* Fast-growing economy looks to iron ore, oil development
By Simon Akam
FREETOWN, Nov 23 (Reuters) - Sierra Leone President Ernest Bai Koroma was sworn in for a second term on Friday after winning elections, promising to boost foreign investment and crack down on corruption in the war-scarred nation.
Koroma took 58.7 percent of the ballots in a Nov. 17 poll, just above the 55 percent he needed to avoid a run-off, election officials announced. His main rival, Julius Maada Bio, a 48-year-old retired army brigadier, took 37.4 percent.
"We will continue to attract investment, we will continue to fight corruption," Koroma said in a speech to cheering supporters in the ramshackle capital Freetown.
"I will make sure that the fruits of ... prosperity are equally distributed in every district and every region. The work starts today."
The election was the third national vote since the end of a 1991-2002 civil war that made Sierra Leone notorious as a "blood diamonds" battleground for rebels and child soldiers.
After Koroma's win was announced, groups of youths shouted and cheered under a cotton tree in the centre of Freetown, a landmark where slaves were once bought and sold.
"I'm pleased, very happy (...) He brings joy in Sierra Leone. Ernest brings joy in the heart of the people," said Abdul Deen, 41, who runs a decorating business.
At stake in the vote was the opportunity to oversee billions of dollars of investment in the aid-dependent country's resources that include gold and diamonds, oil and iron ore.
Iron-ore shipments by British companies African Minerals and London Mining are expected to buoy the economy to 20 percent growth this year - below original forecasts of more than 50 percent, but still one of the highest growth rates on the planet.
Election officials and observers reported a large and enthusiastic turnout in the polls, and observers called the process free and fair.
Koroma and his ruling All People's Congress (APC) faced a determined challenge from Bio, a former junta leader who represents the Sierra Leone People's Party (SLPP).
Koroma wrested the presidency from the SLPP in a hotly disputed 2007 vote and was considered the narrow favourite above Bio, who was involved in two military takeovers in the turbulent 1990s.
Bio supporters were dismayed by the outcome, many claiming the results were fraudulent.
"As for me, the election does not go down well with us," said Frank Mattia, a 28-year-old student. "Ernest Bai Koroma has rigged the election which is not free and fair to us, the people of this country."
The electoral commission said there were some polling stations where votes exceeded registered voters, but said those results were thrown out and were too few to have an impact on the election's outcome.
An SLPP official declined comment, saying an official statement would be issued over the weekend.
The election in the former British colony was one of the most closely observed in Africa this year by monitors from the European Union, the Commonwealth and the African Union.
Doubts remain whether Koroma can root out graft from Sierra Leone's patronage-driven politics and fairly distribute the mineral wealth.
"If they get through this successfully, I think it will mark the tipping point from a post-conflict country to a democratically developing one," John Stremlau, of the Atlanta-based Carter Center's election observer mission, said.