Sri Lankan President Mahinda Rajapaksa faces a fierce political battle after a onetime ally suddenly defected from the ruling party to run against him in Thursday's presidential election.

The November defection by former Health Minister Maithripala Sirisena turned the race, which Rajapaksa had been widely expected to easily win, into a referendum on the president and the enormous power he wields over the island nation.

Rajapaksa's power grew immensely after he crushed the Tamil Tiger rebels in 2009, ending the country's 25-year civil war. After his victory in the last election, in 2010, he jailed his opponent and used his overwhelming parliamentary majority to scrap a constitutional two-term limit for the president and give himself the power to appoint judges, top bureaucrats, police officials and military chiefs.

He also orchestrated the impeachment of the country's chief justice and replaced her with a trusted adviser.

While Rajapaksa's campaign centers around his military victory and his work rebuilding the country's infrastructure and economy, Sirisena's focuses on reining in the president's expanding powers. He also accuses Rajapaksa of corruption, a charge the president denies.

Rajapaksa's power, wealth and political machinery give him large advantages in the election, but the outcome is still hard to predict as reliable polling data is scarce. Sirisena has gathered the support of about two dozen former pro-government lawmakers and political parties representing minority groups and disenchanted Sinhalese voters.