WASHINGTON — Moderate and conservative Republicans in the House reached a deal late Tuesday to vote on two immigration measures next week, delaying for now the discharge petition effort by moderates to force immigration floor votes on a broader range of proposals.

“Members across the Republican Conference have negotiated directly and in good faith with each other for several weeks, and as a result, the House will consider two bills next week that will avert the discharge petition and resolve the border security and immigration issues,” said AshLee Strong, spokeswoman for Speaker Paul Ryan, R-Wis.

Strong did not share any additional details, but said that the full House GOP Conference planned to discuss the plan at a closed-door conference meeting Wednesday morning.

This announcement came after both factions spent several hours negotiating the final terms of a compromise Tuesday evening.

Amid the talks, Freedom Caucus Chairman Mark Meadows, R-N.C., had said that his group would agree to a vote on a compromise bill — whose outline has been floated, but whose text has not yet been written yet — and a conservative bill that had been authored by House Judiciary Committee Chairman Bob Goodlatte, R-Va.

If the effort next week fails in some fashion, Curbelo and other moderates could return to the discharge petition. Bill Clark / CQ-Roll Call, Inc. via AP

Ahead of the deal Tuesday night, Rep. Carlos Curbelo, R-Fla., a sponsor of the discharge petition, said that Ryan had committed to keeping the House in session for several more hours Tuesday in order to allow more members the opportunity to sign on. As of about 10 p.m., the moderates were just two signatures short of the 218 needed to force floor votes on a range of proposals on June 25.

If the effort next week fails in some fashion, moderates could always return to the petition and gain signatures that could lead to a vote in July.

Tuesday's deal follows a week of negotiations between conservatives and leadership that had been focused on a single immigration package that could be submitted for a floor vote. Moderates decided last week to make room for a possible compromise before moving forward with the petition, even as the two groups remained unable to close the gaps on the biggest sticking points, including protection and a path to citizenship for participants in the Deferred Action for Childhood Arrivals (DACA) program, which President Obama created in 2012 and which the Trump administration sought to put an end to last September.

Sources told NBC News last week that conservatives had suggested a new visa system for DACA participants that would lead to a path to citizenship, but the proposal didn’t sufficiently appease moderates.

Speaker Paul Ryan, R-Wis., has repeatedly said that he opposed the petition because he doesn’t find it useful to vote on an immigration proposal that President Trump would not sign into law. Trump has demanded that any legislative solution for DACA be coupled with border security measures, including a significant amount of funding for a wall along the U.S.-Mexico border.

The petition was filed last month by three moderate Republicans: Reps. Jeff Denham of California, Curbelo and Will Hurd of Texas, all of whom represent districts with significant Hispanic populations.