Republican leaders' difficulties passing the Homeland Security Department's funding may show a struggle to demonstrate who's really in charge of Congress.

The stunning House defeat Friday of a three-week spending bill for the agency exposed Speaker John Boehner's weakness in the face of rebellious conservatives. It also demonstrated anew his need to rely on Democratic help at key moments, as the minority party's agreement to a one-week spending bill helped Boehner get it over the finish line with only hours to spare before a threatened agency shutdown. President Barack Obama signed the bill shortly before midnight.

Senate Majority Leader Mitch McConnell had already bowed to the demands of Democrats and stripped contentious provisions rolling back Obama's immigration policies from his chamber's version of the spending bill.