WASHINGTON — A Democratic protest demanding votes on gun-control legislation led to pandemonium in the House chamber that did not end until early Thursday, when Speaker Paul D. Ryan and his fellow Republicans reclaimed control long enough to force through a major spending bill. They then abruptly adjourned and left the Capitol.
Furious Democrats remained on the House floor, where they huddled around their leader, Representative Nancy Pelosi of California, who praised their stand as a “discussion heard around the world.”
Ms. Pelosi expressed bewilderment at the Republican position. “What could they be thinking?” she asked. “Whatever it is, they don’t want to tell anybody about it. That’s why they left in the dead of night.”
The standoff, which began with a Democratic sit-in on the House floor just before noon on Wednesday, did not end until about 3 a.m. Thursday when Mr. Ryan — barreling over Democrats’ objections — took the rare and provocative step of calling a vote on a major appropriations bill in the wee hours and without any debate. He then adjourned the House, with no legislative votes scheduled until July 5.
The House approved the bill, which includes $1.1 billion in emergency financing to fight the mosquito-borne Zika virus — and more than $80 billion in other government spending — by a vote of 239 to 171 shortly after 3 a.m.
Republicans dashed from the chamber into the sticky heat gripping Washington and were met by protesters who jeered, with some shouting, “Do your job!”
Earlier, as Democrats fought for control of the floor, they pressed against the speaker’s dais, waving signs with the names of gun victims and chanting “No bill! No break!” as Mr. Ryan repeatedly banged his gavel in an attempt to restore order.
When Mr. Ryan left the speaker’s chair, Democrats shouted: “Shame! Shame! Shame!”
There were scenes of chaos across the floor as Republicans tried to resume regular business. At one point, Democrats began singing “We Shall Overcome” — altering the lyrics to say “We shall pass a bill some day” — as Republicans shouted in outrage.
And when Representative Don Young, Republican of Alaska, tried to confront the chanting Democrats, he was restrained by aides and colleagues.
The unusual events were set off with the sit-in before noon when Democrats insisted on taking votes on gun measures before Congress began its weeklong recess for the Fourth of July.
“We will not leave the floor of this House until this Congress takes action!” Representative Kathy D. Castor, Democrat of Florida, declared.
Democrats — who do not have enough strength in either the House or Senate to pass legislation on their own — have resorted to spectacle to highlight their anger over Congress not taking action to tighten the nation’s gun-control laws.
The House Democrats’ anger, and their willingness to disrupt the proceedings, seemed to take some Republicans by surprise as they stood on the sidelines.
Ms. Pelosi arrived on the floor with an air of calm, surveying her rank and file’s protest as it gathered steam. Mr. Ryan, in an interview on CNN, dismissed the sit-in as a publicity stunt.
The Democrats began their latest push, including a 15-hour filibuster last week by Senator Christopher S. Murphy, Democrat of Connecticut, after the June 12 massacre at a gay nightclub in Orlando, Fla.
They have repeatedly accused Republicans of siding with the National Rifle Association rather than with the victims of gun violence.
Democrats’ exasperation has grown since Monday, when four gun-control measures — two favored by Democrats and two by Republicans — were defeated in the Senate.
The turmoil on Wednesday and Thursday in the House illustrated the differences in partisan relations in the House and Senate.
Typical of the more restrained and decorous Senate, Mr. Murphy’s speeches last week were derided by Republicans as a pointless “talkathon,” but there were no confrontations and no shouting. Under Senate rules, any one senator who is recognized to speak can hold the floor until relinquishing it.
The House gives the minority no such rights, and the Democrats resorted to an insurrection. Shortly after the sit-in began on Wednesday, Republicans quickly declared a recess, cutting off regular business — as well as the live television feed of floor proceedings, which operates only when the House is in session.
The Democrats were left in control of the chamber, where they gave a series of impassioned speeches and skirted the television blackout by using Twitter’s live-feed Periscope service to broadcast their efforts. That was a violation of House rules, which bans cameras or other electronic devices on the floor.
C-Span picked up the Periscope feed and broadcast as if the House was in session, albeit with the unavoidably shaky camerawork by lawmakers using their cellphones.
Even by the hyperpartisan standards of modern Washington, it was a brazen disruption that underscored the outrage many lawmakers have expressed about the failure of Congress to act on gun legislation in the aftermath of numerous mass shootings.
In 2008, House Republicans, then in the minority, held a “quasi session” during summer recess to protest the Democrats’ refusal to hold votes on energy policy amid sharply rising gasoline prices. The Republicans met in a darkened chamber, a point they recalled with no small amount of outrage amid Democrats’ complaints on Wednesday. A key difference, though, was that the House was in recess then and no business was interrupted as the protest continued for several days.
On Wednesday, Democrats short-circuited an active legislative session, for which Republicans had scheduled votes on a number of measures, including amendments to the annual financial services and general government appropriations bill. By late afternoon, Republicans said they still intended to conduct business, but the Democrats showed no sign of relenting.
Representative Maxine Waters of California seemed to sum up their collective resolve when she said, “I’m prepared to stand here until hell freezes over.”
Ms. Pelosi said her caucus was seeking votes on measures similar to two Democratic proposals that failed to advance in the Senate. One of those sought to ban gun sales to people on the government’s terrorism watch list, while the second would expand and toughen background checks for gun buyers.
Representative John Lewis of Georgia, a hero to many Democrats because of his role in the civil rights movement, initiated the protest on Wednesday.
“We have to occupy the floor of the House until there’s action,” he said.
Congress has long been deadlocked over tightening the nation’s gun laws. But outrage and frustration have grown since the massacre in Orlando and a number of other mass shootings in recent years.
Senator Susan Collins, Republican of Maine, has drafted a narrower compromise measure. But despite some bipartisan backing, that proposal also seems in danger of failing for lack of sufficient Republican support.
Even if all Senate Democrats and the independents who caucus with them voted in favor, which is hardly assured, at least 14 Republicans would need to agree to reach the 60-vote threshold for advancing the measure. Ms. Collins still seemed far short of that number on Wednesday.
Democrats also pushed the gun issue at a hearing of the House Appropriations Committee, putting forward an amendment to the annual Homeland Security spending bill that would bar individuals suspected of terrorist activities from purchasing firearms, similar to a Democratic measure that failed in the Senate on Monday.
“I just want to make it very clear that I’d rather my child be inconvenienced than dead,” said Representative Nita M. Lowey of New York, the committee’s top Democrat.
The amendment failed, with every Republican and two Democrats voting against it.