After Hillary Clinton attacked Donald J. Trump for proposing to bar Muslims from entering the United States, calling him “ISIS’ best friend,” Mr. Trump’s response Monday night was angry and vulgar. He said her bathroom break during Saturday’s Democratic debate was “disgusting,” and he used a crude sexual reference to describe her defeat by Barack Obama for the 2008 nomination.

Mrs. Clinton’s aides could barely believe their good fortune. Mr. Trump had just given them new fodder to galvanize women behind her candidacy — and they used it.

“We are not responding to Trump,” Mrs. Clinton’s communications director, Jennifer Palmieri, responded to Mr. Trump, almost gleefully, on Twitter. “But everyone who understands the humiliation this degrading language inflicts on all women should,” she added, tacking on the campaign’s girl-power hashtag #ImWithHer.

Behind the scenes, the Clinton campaign mobilized a wide network of female supporters to denounce Mr. Trump as “sexist,” as a practitioner of “pathetic, frat-boy politics,” and as more suited to running for “president of the fourth-grade football team.”