Virginia Gov. Ralph Northam on Monday signed a bill into law that will make animal cruelty toward cats and dogs a felony in the commonwealth.

The state's current law requires the animal to die from its injuries for the abuse to be deemed a felony. But under the new law, which comes into effect July 1, anyone who "tortures, willfully inflicts inhumane injury or pain," or "cruelly and unnecessarily beats, maims or mutilates any dog or cat" can be found guilty of a Class-6 felony, punishable by up to five years in prison and a fine of up to $2,500.

The bill was unanimously approved by both Virginia's House of Delegates and Senate before advancing to the governor's office.

Forty-eight U.S. states as well as Washington D.C., Puerto Rico and the Virgin Islands now have laws making certain types of animal cruelty a felony offense, according to the Humane Society of the United States. Virginia was the most recent. There is no federal law that criminalizes animal cruelty, apart from animal fighting and creating or distributing videos that show the killing or torture of animals.

Virginia State Sen. Bill DeSteph introduced the legislation earlier this year after meeting with Virginia Beach Animal Control officials in his constituency who told him about a dog named Sugar.

Sugar was found severely injured in Virginia Beach in 2016 after her owner allegedly beat her with a machete. Authorities arrested the owner, but because Sugar survived the brutal attack, they could only charge him with a Class-1 misdemeanor at the time, punishable by no longer than 12 months in jail and a fine of not more than $2,500.

Although Sugar's case was the catalyst for toughening the state's animal cruelty legislation, the bill was soon dubbed "Tommie's Law" after a pit bull named Tommie was tied to a pole, doused in fuel then set on fire in Richmond on Feb. 10.

Tommie was rescued by Richmond Animal Care and Control but died five days later. A reward of up to $25,000 is being offered for information leading to the arrest and conviction of whoever was involved.

"We have heard from folks all over the commonwealth who share our belief that anyone who intentionally tortures a dog or cat is a threat to public safety, and should be dealt with severely," DeSteph said in a statement. "We were so saddened by the stories of Tommie, the pit bull who recently died after being set on fire, and Sugar, who was viciously attacked with a machete, but are grateful that their stories helped propel this important legislation forward.”

DeSteph told ABC News he plans to send the legislation to other state lawmakers and work with national animal welfare groups to get the law introduced across the country.

There have been studies that show a connection between animal cruelty and many other crimes, from drug and firearm offenses to battery and sexual assault, according to the Humane Society.

“This bill allows our officers to prosecute cruelty regardless of lifesaving medical interventions," Christie Chipps Peters, director of Richmond Animal Care and Control, told ABC News in a statement. "We are grateful to everyone that made this change a reality.”