Majority Sinhalese nationalists protested the death sentence, calling it a betrayal of soldiers who fought against minority Tamil rebels in the 26-year separatist war.
Government troops defeated the Tamil Tiger rebels in 2009, ending the civil war. Both sides have been accused of grave human rights violations. According to conservative U.N. estimates, more than 100,000 people were killed in the conflict.
Rajapaksa, who played a key role in the war as a top defense official, was elected president in November after promising to release soldiers accused of human rights violations.
Sri Lanka withdrew last month from its co-sponsorship of a 2015 resolution at the United Nations Human Rights Council in which it promised to investigate war abuse allegations.
Sri Lanka has had a moratorium on capital punishment for 44 years, and death sentences in effect become life imprisonment.
Copyright 2020 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.