Democratic Gov. Martin O'Malley signed the measure today.
Attending was former Maryland death row inmate Kirk Bloodsworth. He is the first person in the country freed because of DNA evidence after being convicted in a death penalty case.
Maryland is the 18th state to abolish the death penalty.
The bill will not apply to the five men the state has on death row, but the governor can commute their sentences to life without parole. O'Malley has said he will consider them on a case-by-case basis.
The state's last execution was in 2005.