Eleven are running for the Senate. Five for state or local office. One for president of the United States. Another is resigning to become a university president. And more and more say they are hanging up their hats in public office altogether.

More than three dozen members of Congress have announced they will not seek re-election next year, some to pursue other offices and many others simply to get out of Washington. Twelve have announced their plans just this month.

The wave of lawmakers across chambers and parties announcing they intend to leave Congress comes at a time of breathtaking dysfunction on Capitol Hill, primarily instigated by House Republicans. The House G.O.P. majority spent the past few months deposing its leader, waging a weekslong internal war to select a new speaker and struggling to keep federal funding flowing. Right-wing members have rejected any spending legislation that could become law and railed against their new leader for turning to Democrats, as his predecessor did, to avert a government shutdown.

The chaos has Republicans increasingly worried that they could lose their slim House majority next year, a concern that typically prompts a rash of retirements from the party in control. But it is not only G.O.P. lawmakers who are opting to leave; Democrats, too, are rushing for the exits, with retirements across parties this year outpacing those of the past three election cycles.