Only a last-minute change of heart by Democrat leader Nancy Pelosi, D-Calif., spared the Republican speaker from an embarrassing defeat and a possible shutdown of part of the DHS.

At issue was whether the three-week spending bill backed by GOP leadership would be passed with or without funding President Obama’s executive action lifting the threat of deportation from millions of illegal immigrants. Many in Boehner’s party were not willing to pass a bill paying for what they’re calling Obama’s unconstitutional “amnesty” action.

“It does not make any difference whether the funding is for three weeks, three months or a full fiscal year,” argued Rep. Mo Brooks, R-Ala., who voted against the measure. “If it’s illegal, it’s illegal.”