As New York’s attorney general, Eliot Spitzer had broken up prostitution rings before, but this 2004 case took on a special urgency for him. Prosecuting an international sex tourism business based in Queens, he listened to the entreaties of women’s advocates long frustrated by state laws that fell short of dealing with a sex trade expanding rapidly across borders.

And with his typical zeal, he embraced their push for new legislation, including a novel idea at its heart: Go after the men who seek out prostitutes.

It was a question of supply and demand, they all agreed. And one effective way to suppress the demand was to raise the penalties for patronizing a prostitute. In his first months as governor last year, Mr. Spitzer signed the bill into law.

Now the human rights groups, which credit him with what they call the toughest and most comprehensive anti-sex-trade law in the nation, are in shock. Mr. Spitzer stands accused of being one of the very men his law was designed to catch and punish.