O'Malley, a Democrat, is set to sign the measure at a bill-signing ceremony on Thursday.

Maryland will become the 18th state to abolish the death penalty.

The state has five men on death row. The bill will not apply to them retroactively. However, the legislation makes it clear the governor can commute their sentences to life in prison without the possibility of parole. O'Malley has said he will consider them on a case-by-case basis.

The state's last execution took place in 2005, before O'Malley's tenure.

Supporters of the death penalty could still try to petition the bill to the ballot for voters to decide next year, but a petition drive has not yet been announced.