Nearly 20 months after Maryland abolished capital punishment, Gov. Martin O’Malley said Wednesday that he would empty the state’s death row by commuting the sentences of four inmates who were awaiting execution.

“In my judgment, leaving these death sentences in place does not serve the public good of the people of Maryland — present or future,” Mr. O’Malley, a Democrat who will leave office in January and may seek the presidency in 2016, said in a statement. “Gubernatorial inaction at this point in the legal process would, in my judgment, 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.”

Under Mr. O’Malley’s order, four men who had been sentenced to death — Heath Burch, Vernon Evans Jr., Anthony Grandison and Jody Lee Miles — will instead be imprisoned for life without the possibility of parole.

Scott D. Shellenberger, the Baltimore County state’s attorney, criticized Mr. O’Malley’s decision, which he described as “not unexpected.”