Starting next month animal shelters and rescue organizations will have to register with the state under a bill Gov. Andrew Cuomo signed into law Tuesday.

Under the new law, sponsored by state Sen. Phil Boyle, R-Bay Shore, nonprofit animal shelters and rescue organizations will now have to be licensed and inspected by the Department of Agriculture and Markets. Previously, only pet stores and home-based sellers of cat and dogs had to be licensed and inspected by the state.

The new law requires any non-governmentally run animal shelter or rescue group to proactively register with the Department of Agriculture and Markets, which costs $100 annually. Organizations that don’t comply with the law, scheduled to begin in 19 days, would be charged with a civil penalty of between $100 and $1,000.

“For too long, unscrupulous pet dealers have avoided proper oversight, and placed the health of pets under their care at risk in the name of profits,” Cuomo said in a press release. “This legislation closes this loophole and creates a framework that allows regulation of these organizations and companies and creates peace of mind for pet owners.”

In a statement, the bill’s sponsor, Boyle, said that the new measure, which has received the backing of animal rights groups, amends the Pet Dealer’s License exemption that “has sometimes been exploited by former pet dealers and animal resellers who realized they could successfully avoid state oversight by obtaining a not-for-profit status.”

“There are so many wonderful organizations that do incredible and valuable work to help animals, but unfortunately some not-so-great people have used this exemption as an excuse not to be regulated. The number of licensed pet dealers in New York has declined nearly 40 percent over the past five years showing just how troublesome this loophole really is,” Boyle added.

The new law comes months after Attorney General Eric Schneiderman’s office launched an investigation into Suffolk County-based Friends of Freddie, a nonprofit pet rescue facility, accused of selling sick and dying dogs to customers.