WASHINGTON (AP) — Legislative chaos and dysfunction still grip the U.S. Congress even though Republicans promised effective governance after taking control of both houses of the legislature. The battle over funding for the Department of Homeland Security tells the tale.

The Republicans had added in both chambers a demand that agency funding be contingent on killing President Barack Obama's executive action on immigration last fall. He moved to protect from deportation tens of thousands of immigrants in the country illegally. It also would grant them permission to work in the United States.

As the midnight Friday funding deadline approached, it quickly became clear to Senate Republicans that they did not have the 60 votes needed to pass that legislation. They dropped the demand on immigration. But the House of Representatives, mainly because of the refusal of hard-right members, was unable to move forward on the Senate measure.

There was a brief attempt to fund the agency for three weeks to let the situation calm down. The ultraconservatives refused that too. Finally, with hours to spare and with many Democratic votes, House Speaker John Boehner pushed through a bill to give the agency enough money to stay open for seven days. Obama signed the bill into law shortly before midnight.

But the ideological battle was only pushed a few days into the future and turned the spotlight again on the vast rift in the Republican party, especially in the House. It also highlighted Boehner's repeated inability to control right wingers in his Republican caucus who refuse to compromise on their agenda.

Boehner was asked on CBS television Sunday if he could control House Republicans.

"I think so. I think so. I'm not going to suggest it's easy, because it's not," he said.

But he has clearly been stung by the conservative revolt. He, under conservative insistence, is now pushing for the House and Senate to open negotiations on a longer-term funding measure.

The leader of Senate Democrats, Harry Reid, has vowed to block that. And with the Senate Democrats still having sufficient votes to block bringing the measure to a vote, such a conference between the houses seemed pointless.

Boehner continued to insist the problem grew from what he called Obama's unconstitutional overreach on immigration.

A Texas federal judge has added to the complexity of the immigration issue, blocking forward motion on Obama's immigration order. The administration has appealed the ruling. It now is looking like the immigration issue will be settled in the courts, not Congress.

Some in Congress are now questioning Boehner's future as speaker. And in the two months since Republicans became the majority in both houses, they have been defined as much by infighting among themselves and between the House and the Senate as by any achievements.

That raises questions about Congress' ability to accomplish the many tasks before it, including passing a budget, increasing the nation's borrowing authority and passing a new use of force agreement to battle Islamic State militants.

"The DHS funding fight is the first test of the new Republican Congress, and so far they're failing," said Sen. Chuck Schumer, a Democrat. "If the Republicans can't even fund something as simple as Homeland Security, we shudder to think what will happen when it's time to fund the whole government or raise the debt ceiling."

___

Steven R. Hurst is Associated Press international political writer.