Sri Lanka's elections commissioner says opposition candidate Sirisena elected president

Sri Lanka incoming President Maithripala Sirisena waves to supporters as he leaves the election secretariat in Colombo, Sri Lanka, Friday, Jan. 9, 2015. In a stunning election result that was unthinkable just weeks ago, Sri Lanka's longtime president acknowledged Friday that he had been defeated by a onetime political ally, signaling the fall of a family dynasty and the rise of former Cabinet minister Sirisena. (AP Photo/Eranga Jayawardena) (The Associated Press)

Sri Lanka incoming President Maithripala Sirisena waves to supporters as he leaves the election secretariat in Colombo, Sri Lanka, Friday, Jan. 9, 2015. In a stunning election result that was unthinkable just weeks ago, Sri Lanka's longtime president acknowledged Friday that he had been defeated by a onetime political ally, signaling the fall of a family dynasty and the rise of former Cabinet minister Sirisena. (AP Photo/Eranga Jayawardena) (The Associated Press)

Supporters of Sri Lanka's main opposition presidential candidate Maithripala Sirisena celebrates at the end of voting in the presidential election in Colombo, Sri Lanka, Thursday, Jan. 8, 2015. The November defection by former Health Minister Sirisena turned the race, which President Mahinda Rajapaksa had been widely expected to easily win, into a referendum on the president and the enormous power he wields over the island nation of 21 million. (AP Photo/Eranga Jayawardena) (The Associated Press)

Sri Lanka's elections commissioner says opposition candidate Maithripala Sirisena has been elected the country's new president hours after strongman Mahinda Rajapaksa conceded defeat and vacated his official residence.

Mahinda Deshapriya announced Friday that Sirisena obtained 51.28 percent of the valid votes cast in Thursday's election while Rajapaksa got 47.58 percent.

Rajapaksa's defeat was unthinkable until Sirisena defected from the president's Cabinet in November to challenge him.

He will be sworn in as president later Friday.