The immigration stalemate set off an unusually harsh exchange of words, with Senator Harry Reid of Nevada, the majority leader, saying Mr. Boehner's "failure of leadership is enormous." Mr. Boehner, for his part, said the president was guilty of "giving false hope to children and their families that if they enter the country illegally, they will be allowed to stay."
Mr. Obama, in some of his sharpest comments about congressional Republicans, said they could head off the type of executive action they abhor by cooperating on an immigration approach with broad support.
"I take executive action only when we have a serious problem, a serious issue, and Congress chooses to do nothing," he said. "And in this situation, the failure of House Republicans to pass a darn bill is bad for our security, it's bad for our economy and it's bad for our future."
Read MoreDems try end run on Boehner on unemployment
Midterm elections and deep partisanship have not always been obstacles to legislative progress, with members of Congress mindful of the need to score a few legislative victories so they can have something to trumpet to voters back home.
For example, as Republicans tried in 2006 to maintain their majorities — unsuccessfully, as it turned out — they produced a last-minute string of security-related bills on border fencing and port safeguards after enacting a highway bill and an energy measure. However, a major push on immigration legislation came up short that year as well.