J. Scott Applewhite/APHouse Speaker John Boehner of Ohio defends the work of the GOP during a brief news conference on Capitol Hill in Washington, Thursday, July 31, 2014

WASHINGTON — In a huge embarrassment for Republican leaders, the GOP House voted down their bill Friday to avert a Homeland Security shutdown hours before the deadline.

The House GOP plan was to pass a three-week stopgap bill to delay the immigration fight with President Barack Obama until March 19.

But even that failed to pass, losing conservatives who considered it too much of a surrender as well as Democrats who demanded a yearlong DHS funding bill.

The vote was 203-224.

The vote was held open for long after time technically expired, in the hope that members would switch their votes and pull together the number needed for passage. Numerous lawmakers yelled for “regular order” on the House floor, calling for the vote to end.

After it was called, House Majority Leader Kevin McCarthy (R-CA) advised members that further votes may happen on Friday or the weekend.

White House spokesman Josh Earnest earlier Friday excoriated Republicans for refusing to take up a full-year DHS appropriations bill that reflects existing priorities.

“It exposes the danger of playing politics with our homeland security,” Earnest told reporters, while saying Obama would have signed a short-term bill if the alternative was a shutdown. “It represents an abject failure on the part of the new Republican Congress not to get this done.”

Many House Republicans weren’t ready to cave yet and pass a yearlong DHS funding bill, as the Republican-led Senate did on Friday morning. As it turned out, many weren’t even ready to pass a short-term funding bill.

“I’ve been making statements, as has the Speaker, since [December] that the president’s action was unconstitutional. So I’d have to be going back on that,” Rep. Tom Rooney (R-FL) told reporters. “Right now I’m leaning to … standing my ground that what I’ve been saying for the last three months hasn’t been political bullshit. … The bottom line is you’ve got to be able to explain yourself to your constituents that you are not a total hypocrite.”

Speaker John Boehner (R-OH) voted for the bill — a rare move given that the speaker typically doesn’t vote. His allies tried in vain to persuade members that the real battle was in court and that they should pass the DHS bill.

“This is actually a little bit of a side show. I think the decisive arena is actually the courts,” Rep. Tom Cole (R-OK) told reporters. “We can’t achieve a complete victory in Congress. We don’t have the Senate. The president does have a veto.”