WASHINGTON The tense meltdown in the House on Friday over funding for the Department of Homeland Security underscores how Congress has lost the ability to perform its most basic functions no matter which party is in charge.

The outcome — conservative House Republicans initially defeated a stopgap plan to fund the department for three weeks to prevent a politically risky shutdown of the agency — threatens to quickly tarnish Republican claims to sound management of Congress.

The immediate crisis ended late Friday when the House and Senate passed a one-week extension of the security funding, keeping the agency open until lawmakers can revisit the fight next week. But defeat of the initial bill and the way the fight played out diminished hopes for much progress in the months ahead despite the approach of multiple legislative deadlines and crucial issues.

Adding to the pessimism was the fact that House Republicans on Friday had to pull back an education bill that also ran into trouble from conservatives, the third piece of legislation this year that House Republicans had to scuttle temporarily because of internal divisions. If Republicans cannot agree among themselves, what are the chances of finding consensus with Democrats?

Lawmakers in both parties were mortified that weeks of legislative huffing and puffing over the Homeland Security funding had culminated in a collapse in the House over a deal that would quickly put lawmakers back into the same situation just a few days down the line.

“A three-week delay is an embarrassing result, and I hope that the House will get its act together moving forward,” said Sen. Amy Klobuchar, Democrat of Minnesota, speaking before even the three-week proposal was rejected.

“It’s frustrating,” said Rep. Mike Simpson, a veteran Republican from Idaho. “Our argument is we can govern.”

The current chaos has its roots in a critical decision in December when Speaker John A. Boehner and his fellow House leaders set themselves up to fail by deciding to fund the entire government, except for the Department of Homeland Security. Their idea was to fund Homeland Security for only two months and then make funding for the agency for the rest of the year contingent on approval of provisions that would gut the president’s executive actions on immigration.

At the time the deal made sense for both parties. Republican leaders taking unified control of Congress for the first time in eight years were eager to dispose of the budget so they could start the year fresh, and Democrats liked much of the funding that went to federal agencies.

In fact, approval of the spending package represented a return to a more orderly appropriations process after years of stopgap bills, showdowns and budget battles. Lawmakers celebrated and figured they could deal later with the immigration issue, with the most likely outcome that Republicans would have to surrender since they could not be put in the no-win position of shutting down the Homeland Security agency.