Senator Claire McCaskill, Democrat of Missouri, agreed. “There are a lot of us who are frustrated and don’t mind taking tough votes and think we should take more tough votes,” she said.

In the House this week, the rush to accomplish even a relatively modest piece of legislation had a dramatic air, with closed-door meetings and members being summoned back from the airport as the new Republican leadership team worked to avoid embarrassment. Speaker John A. Boehner was swarmed on the House floor Thursday by angry members of his conference who demanded he keep the House in session for as long as it would take for them to vote on a bill.

Mr. Obama, in a mocking tone during a news conference on Friday, said that House Republicans had made the bill “a little more extreme” so it would pass. He then chided Republicans for voting to sue him for an abuse of his executive authority one day, yet demanding that he assert it the next. “They’re not even trying to solve the problem,” the president said, adding they had offered up “a message bill” in order to “check a box before they’re leaving town tomorrow.”

The Republican bill also engendered harsh criticism from Hispanic members of Congress who called it cruel to migrant children. That is a sentiment Democrats will try to stoke in the midterm elections, though few Republicans considered vulnerable come from districts with sizable Hispanic populations. The issue could be more potent in the 2016 presidential campaign.