Republican Kentucky Gov. Matt Bevin has signed into law legislation that makes it a hate crime to attack a police officer or emergency responder.

The state joined Louisiana as the only other state with a "Blue Lives Matter" law.

The bill had drawn opposition from civil rights groups after Rep. Kevin Bratcher, a Republican from Louisville, filed it in the wake of the slayings of five Dallas police officers over the summer.

"Police and firefighters do a very important job for us in society, and I believe if you're going to mess with them for doing their job you're going to get the full brunt of Kentucky law," said Bratcher. "I want to give judges all the tools they need when it comes to punishment for those would hurt our first responders."

Members of Louisville's Black Lives Matter group even went so far as to shout down State House lawmakers in February when the bill was taken up on the floor.

The NAACP Legal Defense Fund urged Bevin to veto the measure, and argued that the new policy "threatens to sow division between police and communities and does nothing to improve officer safety or wellness."

"This bill comes at a moment when our country is in the throes of a national policing crisis," the letter stated. "Using hate crimes laws that have historically been developed to give protection to people of color from distinct forms of violence motivated by prejudice, including police violence, is a particularly disconnected and non-responsive policy choice."

When the law goes into effect July 1, the "hate crime" designation applies to charges like criminal mischief and rioting, as well as to assault, menacing, abuse, unlawful imprisonment, rape and arson.

Judges and parole boards will also be given more discretion in deny probation or parole both during the sentencing process and afterward for those convicted of hate crimes.

The signing of the new law in Kentucky comes as President Trump has shown support for law enforcement by signing an executive order seeking to boost the penalties against those found guilty of assaulting police officers.

According to the National Law Enforcement Officers Memorial Fund, 64 police officers were killed by gunfire in 2016 — up from 41 in 2015. Of those deaths, 21 were the result of ambush-style attacks.