WASHINGTON — President Trump assured governors and members of Congress this week not to be afraid of working with the National Rifle Association to strengthen U.S. gun laws after the mass shooting at a Florida high school last month.

“Don’t worry about the NRA. They’re on our side,” Trump told the governors on Monday.

“They want to do it. These are great people,” he told lawmakers on Wednesday.

But as Trump prepares to announce his school safety proposals this week, NBC News has learned new details about the last major legislative push around gun safety in 2013 that offer a cautionary tale about Trump’s strategy of relying on the NRA.

The NRA’s shrewd lobbying and willingness to walk away from any deal at the last minute suggest congressional negotiators may have good reason to fear working with the nation’s biggest gun lobby.

After a gunman wielding several semi-automatic firearms killed 20 first-graders and six educators at Sandy Hook Elementary School in Newtown, Connecticut, in late 2012, lawmakers believed they had the best opportunity in a generation to overhaul gun laws.

With President Barack Obama’s support, Sen. Joe Manchin, D-W.V., began working with the most senior leadership within the NRA on legislative options. He also brought aboard a Republican co-sponsor, Sen. Pat Toomey of Pennsylvania, for a bill to tighten background checks for gun purchases.

Despite the Sandy Hook tragedy, the NRA’s chief lobbyists Chris Cox, David Lehman and James Baker, ultimately opposed the final package — even after they scored so many concessions in the legislation that a number of gun show owners, among the NRA’s fiercest allies, privately urged the gun lobby to close the deal.

Thanks to the NRA’s lobbying efforts, the Manchin-Toomey bill, which had originated as a gun safety measure, ended up offering more sweeteners than burdensome regulations to the gun industry, with some gun show operators particularly enthused about it. That’s according to interviews with representatives and aides involved in the process who spoke on the condition of anonymity.

The concessions the NRA won included: allowing interstate handgun sales from licensed dealers with a background check; allowing sportsmen traveling from one state to another to legally transport their firearms to the state where they are hunting; removing restrictions on dealer-to-dealer sales at out-of-state gun shows; and making it easier to purchase a firearm in another state.

“There were a whole bunch of things in Manchin-Toomey the gun community has been fighting for for years and still hasn’t gotten,” said Alan Gottlieb, founder of the Second Amendment Foundation, a nonprofit that supports gun rights.

Yet after getting much of what they’d asked for, the NRA rejected the Manchin-Toomey bill anyway. The group advised its gun show members to keep quiet and the bill died on the Senate floor as many of the families of the slain school children looked on.

“The NRA wouldn’t go along with it so gun show owners walked away from it as well,” said Gottlieb, who also blamed Democrats for removing a couple of pro-gun provisions. “With a few little tweaks … it could have flown and worked.”

The question of why remains. The NRA says it never supported the bill’s core of expanding background checks to private transfers and banning any advertising of those sales. A spokeswoman said the bill would not have prevented tragedies such as the recent one in Florida.

Congressional aides say it was unclear until the very end what exactly the NRA would be willing to support, even as its legal department was marking up drafts.

Trump’s rhetoric on Wednesday raised some hopes among lawmakers for progress. “He said 10 times that he would support universal background checks and he wanted a strong bill,” said Sen. Amy Klobuchar, D-Minn., among the attendees. At one point, Trump even poked Toomey for “being afraid of the NRA,” suggesting he’d be willing to buck the group on some measures.

Yet five years after Manchin-Toomey’s defeat, Trump’s claim that the NRA now wants to do something “very strong” on stricter gun laws invites a more complete autopsy of what happened in 2013.

Sen. Joe Manchin of West Virginia, D-W.Va., left, and Sen. Patrick Toomey, R-Pa. J. Scott Applewhite / AP file

The fact that the legislation was championed by Obama, a Democrat viewed by the NRA as hostile to gun rights, also likely played a significant role, gun allies say. The gun lobby was reluctant to give Obama a major legislative victory lest his presidency follow the path of a previous Democratic president, Bill Clinton, who successfully championed an assault weapons ban in 1994. That law expired in 2004 and has not been renewed.

Perhaps the NRA would be more willing to work with a President Trump. Yet in a statement Wednesday night, an NRA spokeswoman, Jennifer Baker, said the proposals Trump floated “would make for bad policy that would not keep our children safe” and urged Congress to fix “the broken mental health system” and strengthen reporting requirements in the current system.

Finally, the NRA for years has feared loss of membership to the competing Gun Owners of America, which maintains a firm noncompromise stance.

His bill's failure still haunts Manchin, who faces a tough re-election bid this year and is hesitant to revive his signature legislation. Weeks after the bill failed in 2013, and despite receiving top ratings and campaign endorsements from gun rights advocates, Manchin was targeted by the NRA, who spent $100,000 in negative advertising linking him to Obama and then-New York Mayor Michael Bloomberg, a strong gun control activist.

Many lawmakers in both parties now say they are open to new legislation around guns in the wake of the mass shooting at Marjory Stoneman Douglas High School in Parkland, Florida, on Feb. 14 that left 17 people dead.

On Tuesday, Senate Minority Leader Chuck Schumer, D-N.Y., said he hopes Republicans will “buck the NRA and do the right thing."

"You can’t solve this problem and please the NRA,” he said.

There are few Republicans coming forward to support major legislation even as the advocacy of students from Douglas H.S. has resulted in an unusual burst of blowback aimed at the gun lobby. Major companies including Hertz and Wyndham Worldwide, among others, have canceled corporate partnerships with the NRA.

The NRA’s influence over its members and lawmakers remains considerable.

For months after Sandy Hook, Manchin’s office had been talking with then-Sen. Tom Coburn of Oklahoma as a potential Republican sponsor.

Tulsa, Oklahoma, is home to some of the nation’s biggest gun shows. According to an aide close to the process, Coburn backed out citing, among other things, a change of heart by one of his state’s biggest gun-show owners. Manchin later turned to Toomey as a Republican co-sponsor.

A source close to Coburn said Democrats walked away from him — and it was because of a dispute over a record keeping provision and not pressure from gun show operators.

Asked this week about whether he planned to take another stab at legislation, Manchin wouldn’t commit to it without more pledges of support from Republicans.

“You can reintroduce all the bills you want to, I’m happy to do that if it makes people happy, but I like to get things done,” he said.

In 2013, the NRA seemed willing to reach an agreement on a new gun safety measure. Manchin and Toomey’s offices were in constant negotiation with the NRA and its legal department to craft the bill. Cox and Lehman, the group's lobbyists, held several meetings with the bill’s authors, convincing lawmakers not to aim for a complete overhaul of U.S. background check laws, and securing a number of longtime NRA priorities.

Many gun show owners actually wanted a loophole allowing individual sales at gun shows without a background check closed, according to the individuals.

That’s because the overwhelming number of sellers at gun shows are federally licensed dealers mandated to run a background check, and most promoters are eager to avoid lawsuits involving nonlicensed sales on their premises.

Another plus for show promoters: The NRA had secured a requirement to shorten the maximum waiting period for a mandatory background check through the National Instant Criminal Background Check System to two days from three.

Finally, there wasn’t a single provision banning the sale of any class of firearm.

Even Jeff Nugent, the older brother of conservative musician and NRA board member Ted Nugent, took on the NRA in a Washington Post editorial in May 2013 as the bill fell apart: “The NRA has it wrong: Irresponsible gun owners are bad for everyone,” wrote Nugent, a former executive at Revlon.

Gottlieb, the gun rights advocate, said the bill was the victim of political sniping by lawmakers who refuse to compromise.

“Both sides like to have the issue alive,” Gottlieb said. “Sometimes it’s like they want to keep the fight going instead of do something that makes sense."

When it comes to the gun debate, he said, "things aren’t always as they appear.”