The Maryland General Assembly restored Tuesday the right to vote for more than 40,000 released felons, overriding a veto by Governor Larry Hogan. Maryland’s Senate approved the bill on a narrow 29-18 vote, while the state House of Delegates voted 85-56 in favor of it on January 20.

Under the state’s previous laws, felons regained the right to vote after completing their entire sentence, including probation or parole. The new law restores voting rights to felons who are no longer imprisoned, but are still under probation or parole.

About 44,000 Marylanders will regain their vote under the new law, according to the Washington Post. The law goes into effect in 30 days, just over one month before the state’s primary elections on April 26.

Legislators in the Democratic-controlled General Assembly have overridden all six vetoes issued by Hogan, a Republican, in the latest legislative session. In his veto statement last May, Hogan argued the current law “achieves the proper balance between the repayment of obligations to society for a felony conviction and the restoration of various rights,” including the right to vote.

Only Maine and Vermont impose no barriers on felon voting, and even allow prisoners to cast ballots while incarcerated. Restrictions in the other 48 states vary by crime and sentence. Maryland’s current system follows the general norm, in which states require a felon’s release from prison and completion of probation or parole before his or her voting rights are restored.

A small number of states are far more severe. Florida, Iowa, and Kentucky impose lifetime bans, though all three states have mechanisms to lift it. In November, outgoing Kentucky Governor Steve Beshear signed an executive order that restored voting rights for 140,000 nonviolent felons. His successor, Matt Bevin, rescinded the order shortly after taking office in December.

Overall, the Sentencing Project estimates that roughly 5.85 million otherwise eligible Americans can’t cast a ballot due to felon disenfranchisement. Perhaps the most dramatic effects are felt in Florida, where more than 1 in 10 Floridians cannot vote due to the state’s severe restrictions. Like virtually every other aspect of the criminal-justice system, its impact is felt disproportionately among black and Hispanic communities, with almost one-quarter of Florida’s black voting-age residents disenfranchised as of 2014.

The contested 2000 presidential election offers the most striking example of the impact of felon disenfranchisement. Republican candidate George W. Bush won Florida by a razor-thin margin of 537 votes, giving him a narrow victory in the Electoral College. But a 2002 study in the American Sociological Review concluded that if the state’s 827,000 disenfranchised felons had voted at the same rate as other Floridians, Democratic candidate Al Gore would have won Florida—and the presidency—by more than 80,000 votes.