New York on Monday became the first state in the country to ban cat declawing, a practice that animal advocates consider cruel and unnecessary. Gov. Andrew M. Cuomo signed the bill into law after state legislators passed the ban last month.

“By banning this archaic practice, we will ensure that animals are no longer subjected to these inhumane and unnecessary procedures,” Governor Cuomo, a Democrat, said in a statement.

The law goes into effect immediately and makes exceptions for medical purposes. Performing the procedure on a cat for any other reason could lead to a fine of up to $1,000.

Assemblywoman Linda B. Rosenthal, a Democrat, first introduced the bill in January 2015. “As a cat lover and someone who has cats, I said this is cruel, barbaric and inhumane,” Ms. Rosenthal said on Monday.