WASHINGTON -- With only three days remaining before the Department of Homeland Security funding runs out, a complicated procedural deal has emerged that could avert a DHS shutdown -- if Speaker John Boehner is willing to get on board.

Conservatives' determination to oppose President Barack Obama’s executive orders on immigration appears to be giving way to the need to fund the agency. On Tuesday Senate Majority Leader Mitch McConnell offered a path out, saying he would let the Senate vote on a bill that would block the orders, and then allow senators to fund DHS. But he’s going to need virtually every leader in Congress to agree.

Boehner has so far refused to bring a "clean" DHS funding bill -- one that doesn't also include immigration rollbacks -- to the floor. But that doesn't mean he won't ultimately agree to let a bill to fund DHS come up for a vote before the week ends. “All eyes are on Speaker Boehner,” a Senate Democratic leadership aide said.

Congressional tensions -- between conservative and moderate Republicans as much as between the GOP and Democrats -- mean that the simple process of funding government is now a twisted series of procedural votes and cross-chamber demands. 

This latest chapter started in the House, where conservatives pressed Boehner to use funding for DHS as leverage to fight the president’s executive orders on immigration. The House passed a bill that would fund the agency but also reverse all of the president’s executive orders on immigration. Not only would it undo orders signed in November to provide legal status to about 5 million people, it also would reverse previous actions that allowed those who were brought to the country as children (known as Dreamers) to remain.

The House-passed bill needed 60 votes in the Senate to clear a procedural hurdle. With only 54 Republicans, Democrats held strong and prevented the bill from moving forward. Now GOP leaders blame Senate Democrats for the shutdown showdown, while Democrats insist that a “clean” funding bill would pass and keep the agency open past Feb. 27, when the current funding runs out. 

So on Tuesday McConnell announced he will do just that. He will allow the Senate to vote on a clean funding bill. And he filed a second bill that would reverse Obama’s executive orders on immigration from last year. McConnell said if Senate Minority Leader Harry Reid agrees to votes on both bills, they could act as soon as Wednesday to vote to avert the shutdown.

“I would be happy to have his cooperation to advance the consideration of a clean DHS bill that would carry us forward until September,” McConnell said.

But Reid wasn’t ready to claim victory that Republicans had finally agreed to a clean bill. After McConnell’s announcement, Reid said he would only go along with the arrangement if Boehner agrees.

“I’m waiting to hear from the speaker to be sure that people understand the  bicameral nature,” Reid said. “To have Sen. McConnell just pass the ball over to the House just isn’t going to do it.”

Reid’s tact to make the decision about Boehner carries its risk. Much of the blame for a possible shutdown so far has been squarely placed on Republicans, but if Democrats are seen as holding up an agreement, that sentiment could shift. Reid’s response, of course, prompted criticism from congressional Republicans.

"Apparently inspired by President Obama's own overreach, Sen. Reid is now shamelessly threatening to filibuster a 'clean' Homeland Security funding bill,” a senior House GOP aide said. “The American people are watching, and there will be consequences for Senate Democrats' hypocrisy and irresponsibility."

Boehner will meet with the rest of the Republican House members on Tuesday morning as part of their weekly conference meeting. How much pushback he gets from conservatives -- or encouragement from moderates and those fearful of a shutdown -- is likely to be the deciding factor on whether the bill moves forward.