After years of watching a group of conservatives gang up to get what they want, moderate House Republicans are now doing the same — and House Speaker Paul Ryan is caught in the middle.

Two factions of the party are openly battling over the path forward on immigration. They are roughly equal in size, with a few dozen members each. But while the conservative Freedom Caucus often works as a voting bloc to win concessions and give headaches to Republican leadership, moderates almost never do.

That changed this month. Moderates aren’t just working together: They have a unique advantage in that Democrats will side with them on an immigration plan.

The moderates are trying to take control of the floor schedule through a majority override known as a discharge petition. Petition author Rep. Jeff Denham says his group has enough support to get to 218 signatures — made up of a couple dozen Republicans and most or all Democrats — which would force a series of immigration votes to the floor over the objections of Paul Ryan.

Siding with the minority like this party is rare and hasn’t happened in three years. It’s a tactic born out of frustration, said outgoing Rep. Ryan Costello, and moderates could start voting as a bloc more often.

“If I stayed around I would be pushing that. Because what else are you going to do?” he said. “Going along to get along will only get you so far when they [the Freedom Caucus] keep doing the same thing. So you’ve got to press your button.”

Asked if moderates are taking a page from his group’s playbook, Freedom Caucus chair Mark Meadows said, “there’s over 2,000 pages in the Jefferson manual that apply to every member, and they can always use it.”

The Freedom Caucus is demanding Paul Ryan use his procedural powers to block the petition by any means necessary because they believe an open immigration debate will lead to the passage of a more liberal bill.

Ryan has tools to stop it. For example, discharge petitions can only take over the schedule on certain Mondays, and Paul Ryan could just schedule the House to be out every Monday. Members of the Freedom Caucus have said that leadership will be held personally responsible if the petition succeeds.

“Leadership can stop this,” said Freedom Caucus member Rep. Scott Perry. “If you don’t want the tyranny of the minority to take over, and you’re in leadership, there are methods to make sure that policy the American people didn’t ask for doesn’t come to the floor.”

But moderates insist that if Ryan uses procedural maneuvers to block them that there will be hell to pay. Doing this would “blow up” the goodwill to negotiate within the party and “then all bets are off,” said Rep. Mario Diaz-Balart.

Ryan acknowledged Tuesday that Republicans at opposite ends of the spectrum are frustrated with each other. He said leadership is “trying to find where the consensus sweet spot is.”

But in a separate interview, Republican Deputy Whip Patrick McHenry said there appears to be no middle ground between having an open immigration debate and not having one. “We are a year and a half into the Congress without a series of votes on immigration for lack of some sweet spot,” he said.

Leadership and members of each group met Monday, and there are plans to continue meeting throughout the week to try to work out a deal. Moderates are keeping the discharge petition active as leverage. Denham, one of the lead moderates, said they have the numbers and will be adding signatures throughout the week. The stated plan is to hit 218 by the end of the week if Ryan doesn’t give moderates a deal they want. It is currently 16 signatures short.

Moderates are pushing for a bill that pairs border security funding with a path to citizenship for hundreds of thousands of people brought into the United States as children, known as DREAMers. The Freedom Caucus supports a bill that provides money for a Mexican border wall, cuts immigration rates, and provides only short-term work permits for DREAMers.

While Ryan is retiring in January, the standoff puts pressure on those who would hope to replace him, most notably House Majority Leader Kevin McCarthy. McCarthy has come out hard against the petition, breaking with some of his fellow California Republicans. He’ll need to appease the Freedom Caucus in order to win power next year. But he also needs to keep moderates onside.

“It’s a dicey thing to say ‘I’m going to give the Freedom Caucus what they need’ and risk the ire of (dozens of moderates),” said Rep. Chris Collins. “God bless anyone that is speaker or wants to be speaker, because it’s as dicey as it comes.”