WASHINGTON — Donald J. Trump said Wednesday that people on the terror watch list should be barred from buying firearms, putting himself in the center of a gun-control debate in Congress revived by the worst mass shooting in United States history.

Mr. Trump’s stance, expressed in a Twitter post, does not necessarily jibe with the positions of the Republican Party and the National Rifle Association, whose endorsement Mr. Trump frequently boasts about on the campaign trail. His tweet could be read to support measures pushed by Democrats and opposed by Republicans in Congress, reflecting the unusual nuances of the issue, which touches on public safety and civil rights beyond the Second Amendment.

“I will be meeting with the N.R.A., who has endorsed me, about not allowing people on the terrorist watch list, or the no-fly list, to buy guns,” Mr. Trump, the presumptive Republican presidential nominee, wrote Wednesday morning on Twitter. His comment came three days after 49 people were killed when a gunman who pledged allegiance to the Islamic State stormed an Orlando nightclub.

On the same morning, a group of Democrats took to the Senate floor in a filibuster to protest the lack of improvement in gun safety measures in recent years.

“I’ve had enough,” said Senator Christopher S. Murphy, Democrat of Connecticut, who spoke on and off for more than 14 hours. “I couldn’t just come back to the Senate this week and pretend like this is business as usual.”

When he finished talking shortly after 2 a.m. on Thursday, Mr. Murphy said he had secured agreement for votes on the measures.

Video

At a campaign event in Atlanta, Donald J. Trump offered additional commentary on the Orlando, Fla., shooting and reinforced his opinion that people should report suspects.CreditCreditDamon Winter/The New York Times

“I am proud to announce that after 14+ hours on the floor, we will have a vote on closing the terror gap & universal background checks,” Mr. Murphy said in a Twitter message posted around 1:50 a.m.

The filibuster drew significant attention online, with supporters tweeting support and encouragement as the hours dragged on. Mr. Murphy acknowledged that support after ending the filibuster.

The Democratic legislation, sponsored by Senator Dianne Feinstein of California, would seek to prevent individuals on the government’s terror watch list from purchasing guns on the recommendation of the Justice Department alone. Ms. Feinstein unsuccessfully proposed a similar measure last year, after 14 people were killed by an Islamic extremist couple in San Bernardino, Calif.

The legislation she is now proposing goes even further, covering not just people on the watch list at the time of purchase, but anyone who had been on the list in the preceding five years. The Orlando gunman, Omar Mateen, had been on the list but was removed after an F.B.I. investigation turned up no evidence that he was plotting any crimes.

N.R.A. officials said on Twitter that they would be happy to meet with Mr. Trump, but that the group had not changed its position: withholding guns from people on the terrorist watch list, the vast majority of whom have not been charged with a crime, would give the government too much power to deny people of their Second Amendment right. At one point in 2014, the list had 800,000 names, and in the past famous Americans like Senator Ted Kennedy and Representative John Lewis had undergone additional screening at airports because their names were similar to those on the list.

The group has supported a competing measure put forward by Republicans, led by Senator John Cornyn of Texas. Under the proposal, when someone on the watch list tried to buy a gun, federal prosecutors would have three days to persuade a judge that there is probable cause to deny the purchase. Democrats say that burden is too high.

“The N.R.A. believes that terrorists should not be allowed to purchase or possess firearms, period,” said Chris W. Cox, the executive director of the group’s Institute for Legislative Action, in a statement. “At the same time, due process protections should be put in place that allow law-abiding Americans who are wrongly put on a watch list to be removed.”

A spokeswoman for Mr. Trump confirmed that he met with Mr. Cox in New York on Tuesday, though the terror watch list was not on the agenda.

Mr. Trump’s campaign did not clarify Wednesday how far his proposal would go or articulate which of the dueling measures — Mr. Cornyn’s or Ms. Feinstein’s — Mr. Trump most agrees with.

Democrats were not counting on Mr. Trump’s support and almost seemed not to want it. They have been more than happy to associate him with the N.R.A., which Democrats view as the biggest obstacle to gun control.

Republicans are under pressure to show some action in response to the Orlando shooting, and Mr. Cornyn said on Wednesday evening that he was working with Ms. Feinstein on a potential compromise. But Ms. Feinstein, speaking to reporters after a classified briefing on the Orlando shooting that Mr. Cornyn also attended, said she doubted a deal would be reached.

During the primaries, Mr. Trump, who is a gun owner, spoke often about his affinity for guns as a way to prove his conservatism. He is in step with the N.R.A. on virtually all other gun issues, including his opposition to a ban on assault weapons. “By the way, I’m going to save your Second Amendment,” he said Wednesday at a rally in Atlanta.

As he has after other mass shootings, Mr. Trump said Wednesday that more gun ownership was the answer, not less. He said that the carnage could have been minimized “if some of those great people that were in that club that night had guns strapped to their waist or strapped to their ankle, and if the bullets were going in the other direction.”

Actual floor debate on any of the proposals in Congress was not expected until Thursday at the earliest.

Mr. Murphy was aided by a large cast of Democrats but especially his fellow Connecticut senator, Richard Blumenthal, as well as Cory A. Booker of New Jersey and Richard J. Durbin of Illinois, the minority whip.

They yielded briefly for questions from Republicans but otherwise talked incessantly about the need for tighter gun control. By early evening, the Democrats brought out a poster showing photographs of victims of the Orlando shooting. Senator Tammy Baldwin, Democrat of Wisconsin, stood next to the poster, reading out the victims’ names and speaking about their lives.

A spokesman for Senator Mitch McConnell of Kentucky, the Republican leader, said that the speechmaking by Democrats was merely delaying the consideration of the gun-related measures, as well as proposals on F.B.I. financing and other amendments to the Senate appropriations bill.

Jonathan Lowy, director of the Legal Action Project of the Brady Center to Prevent Gun Violence, said that while the Democratic legislation was “a very promising step in the right direction,” none of the proposals currently under consideration go far enough.

“We need to require background checks for all gun sales if we truly want to keep guns out of the hands of terrorists and other dangerous people,” Mr. Lowy said.

Mr. Lowy added that he still does not entirely understand what Mr. Trump is proposing. “You certainly can’t enact the tweet into law — you need more specifics than that,” he said. “We’ll have to see what actual legislation, if any, Trump actually supports.”

A version of this article appears in print on , on Page A1 of the New York edition with the headline: As Gun Control Debate Flares, Trump Veers From the Party Line. Order Reprints | Today’s Paper | Subscribe