Despite intense lobbying by opponents, the Massachusetts Legislature last week passed a controversial habitual offender bill known as the “three-strikes” law.

Under the law, felons who’ve been convicted of at least three violent crimes, with at least one of those convictions resulting in a prison sentence of at least three years, cannot petition for parole.

Supporters of the bill pointed to two horrific high-profile cases from recent years to bolster their argument for its necessity: the 1999 Cape Cod murder of Melissa Gosule by a parolee with a history of committing violent crimes, and the 2010 death of John Maguire, a Woburn police officer shot by a man who was on parole after being convicted of assault and armed robbery. The bill, they said, would protect the public from “the worst of the worst” criminals.

But critics of the bill countered that it was overly broad in its scope and would result in people convicted of less serious crimes being denied the opportunity to apply for parole, worsening the state’s prison overcrowding problem in the process. Opponents of the bill include the American Civil Liberties Union, numerous criminal justice reform groups, and some judges, who argued that the proposal robs the courts of the ability to decide individual cases on their own merits. (See “Good Time or Hard Time,” Jan. 26, 2012)

But those arguments were not enough to sway legislators, who overwhelmingly supported the bill. In the Senate, it passed by a vote of 31 to 7; in the House, by 139 to 14.

The three-strikes bill was supported by the entire Western Mass. delegation, with three exceptions: state Reps. Cheryl Coakley-Rivera and Ben Swan, both Springfield Democrats, and Rep. Tricia Farley-Bouvier, a Democrat from Pittsfield, voted against it.

The bill did contain some elements supported by advocates of reforming the justice system: it shrinks so-called “school zones,” which allow prosecutors to impose harsher penalties for drug crimes committed near schools, from 1,000 feet to 300 feet. (See “Urban Penalty,” Feb. 26, 2009) It also contains reductions in mandatory minimum sentences for certain drug crimes and allows some drug offenders to qualify for programs designed to help them with re-entry, such as parole and work release programs.

After the bill’s passage, Families Against Mandatory Minimums, a national advocacy group, released a statement saying it supported those changes but called for more extensive reforms. “During debate on the bill, there was a bipartisan recognition of the need to restructure our system of mandatory drug sentencing laws, not just to adjust them. That has been our position all along,” Barbara Dougan, director of FAMM’s Massachusetts project, said in the release. “For that reason, FAMM is urging the Governor to send the bill back to the Legislature with amendments that would improve it. But regardless of what happens with this bill, we will be back next session fighting for real change.”

Dougan also criticized the three-strikes provision, saying, “We are especially troubled by the lack of any mechanism that would give the courts discretion in specific cases where this law would require an overly harsh sentence.”

At deadline, the bill was headed to Gov. Deval Patrick for his signature. Last week, the governor told a Boston television station, “It’s not a bad bill, it’s just not as good as it could have been. And it’s not the last word. We really have to come back to this whole question of mandatory minimum sentencing and whether that works anymore.”