Mr. Frelinghuysen was facing a challenge from Mikie Sherrill, a former Navy pilot and federal prosecutor, who has the backing of four key Democratic county chairs. And a new super PAC, NJ 11th For Change, was established to help organize a grass-roots effort to unseat Mr. Frelinghuysen.

The group has been relentless in their efforts, holding regular protests outside Mr. Frelinghuysen’s offices and flooding social media with critical messages. And Mr. Frelinghuysen had not been acting like a candidate girding for what was shaping up to be the battle of his political career. He had not been aggressively fund-raising and he has avoided holding town hall meetings.

Still, Mr. Frelinghuysen would have made a formidable candidate — he has decades of name-recognition and nearly $1 million in the bank. Now, whoever ends up being the Republican candidate will be starting from scratch financially even as Democrats in the district have raised hundreds of thousands of dollars.

Ms. Sherrill announced she began 2018 with more than $820,000 in cash-on-hand, hours after Mr. Frelinghuysen said he would retire. She is one of 18 candidates across the country who the Democratic Congressional Campaign Committee has selected to support as part of its “Red to Blue” initiative.

Though Mr. Frelinghuysen had shown signs that he might not run, his decision still caught party leaders by surprise and they quickly got to work trying to identify potential replacements.

For New Jersey, Mr. Frelinghuysen’s retirement means the loss of someone who could direct resources to the state. Mr. Frelinghuysen has been a strong advocate for one of the region’s most important infrastructure projects, a new rail tunnel under the Hudson River. He had also been instrumental in steering about $900 million to replace the Portal Bridge near Newark, a key piece of the Northeast Corridor that is prone to malfunctions.

Mr. Frelinghuysen has often been caught between the direction of the party and the desires of his home state. He voted against the federal tax law, citing the harm it would inflict on many of his constituents by limiting the deductibility of state income taxes and property taxes. His vote reportedly angered Republican leadership, and Paul D. Ryan, the House speaker, threatened to strip Mr. Frelinghuysen of his leadership role.