House Republicans decided that the tail had wagged the dog long enough.

During a special closed-door meeting July 25, resistance to legislation to address the border crisis from House Republicans’ insurgent wing threatened to paralyze the conference and kill their bill.

House GOP leaders — and more importantly, the vast majority of the rank and file who are conservative pragmatists — fought back. Rather than throw up their hands in frustrated defeat as they had so many times before, they confronted their recalcitrant colleagues.

They saved their bill that day. But it nearly died again a week later, when House leaders pulled it from a vote at the last minute Thursday once they saw they didn't have the votes for the $694 million package to improve border security and make it easier to deport illegal immigrants.

Once again, the pragmatists put up a fight.

Rather than giving up and heading home for the five-week August recess empty handed, members cornered Speaker John Boehner, R-Ohio, on the House floor and demanded that he keep their colleagues in Washington until a bill passed.

A little over 24 hours later, after making minor modifications — granted, to satisfy the immigration hawks — the legislation passed with 222 Republican votes, four more than needed to ensure approval.

“We can’t leave in August without resolving this. We can not go home,” House Energy and Commerce Chairman Fred Upton, R-Mich., said Friday. “It messed up our plans to go home, but we’re here to make some tough choices.”

The fight that saved the border bill has its roots in last October’s government shutdown.

In the weeks leading up to the shutdown, House GOP leadership counseled conservative insurgents against shutting down the government in an attempt to force President Obama to sign a spending bill that defunded his signature health care overhaul.

Republican leaders warned that it would fail, both substantively and politically, and a majority of the rank and file agreed. But a sizable minority of the majority’s conservative insurgents refused to budge.

Leadership and the majority opposed to the shutdown felt cornered and reluctantly joined their insurgent colleagues, deciding that a unified conference trumped division. At the time, when House Republicans were asked who did most of the talking in the closed-door meetings held to consider whether or not to support the shutdown, members said most of those who were outspoken were those who supported the strategy.

That experience had a lasting effect on the silent majority going forward. When the fate of the border bill was in doubt in late July because of opposition from a vocal minority, the vast majority of Republicans who supported the measure were quick to speak up. They were adamant about preventing this group from controlling the direction of the conference.

“Perhaps our experience over the last year and a half influenced a decision to stick it out a little bit longer,” said House Republican Conference Chairwoman Cathy McMorris Rodgers of Washington.

For many Republicans, there also has been an ongoing frustration with members who are influenced by conservative advocacy groups, talk radio hosts and GOP senators, most notably Ted Cruz of Texas, the principle advocate behind the government shutdown, and on immigration issues, Alabama’s Jeff Sessions.

On a variety of issues, many House Republicans have quietly seethed because they felt their caucus’ insurgent wing has prevented incremental progress on conservative priorities the conference was otherwise united in support of.

Several times, the conference has been close to an agreement on a major issue, only to see it scuttled after Tea Party-affiliated members were lobbied by outside groups or criticized by talk radio hosts.

This exasperation has extended to the insurgents’ choice of political tactics, which many rank-and-file members believe has tarnished the Republican Party’s brand with voters and made it harder for the House GOP majority to pressure Obama and the Democratic Senate into giving their proposals serious consideration.

For Rep. Jeff Denham, this frustration boiled over in the July 25 meeting.

The California Republican favors comprehensive immigration reform, with the caveat that the southern border with Mexico be secured first. When some of the most ardent Republican foes of immigration reform — those who are always demanding that the border be secured before other reforms are considered — express opposition to a border bill that was almost solely focused on security and deportations, he unloaded on his more stubborn colleagues.

“It is time for every member to assess why they’re here and to actually look at their voting card and take all of the information and then make a decision based on our country and based on their district,” Denham said. “But just voting ‘no’ is not a solution.”