Good news.

WASHINGTON — A few hours after Conor Lamb, the Pennsylvania Democrat, claimed victory in a House race with a vow to oppose his party’s leader, Nancy Pelosi, the once-and-perhaps-future speaker was explaining to a group of female congressional candidates why she did not retire after 2016.

She intended to do so after Hillary Clinton won, Ms. Pelosi recalled Wednesday at a Democratic Congressional Campaign Committee reception here. But she stayed to ensure Washington had at least one woman in power.

To some lawmakers in the room who described her remarks, the message was clear: Ms. Pelosi is not going anywhere — a point she underscored in an interview.

Yet her resolve is at odds with growing numbers of Democratic candidates who view her as politically toxic and are pledging to vote against her as their leader, as Mr. Lamb did without suffering consequences with voters and donors. These candidates and some current House Democrats — tired of years of attack ads invoking Ms. Pelosi as a “San Francisco liberal,” and impatient to see a younger set of leaders take power — are now openly distancing themselves from Ms. Pelosi or declaring outright that it is time for her to go.

Mr. Lamb, by coming out early against Ms. Pelosi and scoring an upset win in a district President Trump carried by nearly 20 percentage points, has clearly emboldened some other Democrats to follow suit and disavow her. Republicans intend to make Ms. Pelosi’s unpopularity a centerpiece of their 2018 strategy, hoping that her polarizing status will mitigate their predicted losses.