ANNAPOLIS, Md. — In one of his final acts as governor, Democrat Martin O’Malley announced Wednesday that he will commute the sentences of four death-row inmates to life in prison without parole.

Two years ago, the General Assembly abolished the death penalty, leaving five inmates on death row. One of them, John Booth-El, died in prison this year.

The governor said he had met or spoken with many of the relatives of the people killed by the inmates. Some victim family members and prosecutors were upset with O’Malley’s decision.

O’Malley said that if he didn’t commute the sentences the legal process would “needlessly and callously subject survivors, and the people of Maryland, to the ordeal of an endless appeals process, with unpredictable twists and turns, and without any hope of finality or closure.”O’Malley, who is considering running for president in 2016, will leave office next month after two terms. The governor is a Catholic and longtime opponent of capital punishment.