President Donald Trump responded to the El Paso and Dayton mass shootings by insisting Monday that “mental illness pulls the trigger not the gun,” but shortly after taking office he quietly rolled back an Obama-era regulation that would have made it harder for people with mental illness to buy guns.

Trump did so without any fanfare. In fact, the news that Trump had signed the bill was at the bottom of a White House email that alerted the media to other legislation signed by the president.

And it came after the House and Senate, both of which were Republican-controlled at the time, passed a bill, H.J. Res 40, which revoked the Obama-era regulation. The bill was sponsored by Rep. Sam Johnson, a Texas Republican who retired at the end of 2018.

Pressed by NBC News why Trump nullified the rule, White House spokesman Judd Deere said Tuesday: “This was a wide-ranging regulation promulgated in the 11th hour of the previous administration that included all kinds of people with disabilities who are more than capable of owning a firearm. The rule went too far.”

The latest mass shootings left at least 30 dead and horrified the nation.

In a statement, the National Rifle Association said it "welcomes the President's call to address the root causes of the horrific acts of violence that have occurred in our country."

"It has been the NRA’s long-standing position that those who have been adjudicated as a danger to themselves or others should not have access to firearms and should be admitted for treatment," it said.

But two years ago, the NRA insisted the Obama rule infringed on Second Amendment rights to buy guns, even though the regulation specifically targeted people who were diagnosed with mental illness.

The NRA “applauded” Trump’s action at the time and then-executive director Chris Cox said the move “marks a new era for law-abiding gun owners, as we now have a president who respects and supports our arms.”

The Obama rule that Trump nullified had added people receiving Social Security checks for mental illnesses and people deemed unfit to handle their financial affairs to the national background check database.

Had that rule taken effect, the Obama administration predicted it would have added 75,000 names to the national background check database.

Obama had recommended the regulation after the 2012 mass shooting at Sandy Hook Elementary School that left 20 first-graders and six others dead. The measure sought to block some people with severe mental health problems from buying guns.

Sen. Chris Murphy, D-Conn., a leading gun control advocate in Congress, denounced Trump in 2017 for getting rid of the Obama restrictions and blasted the GOP.

"Republicans always say we don’t need new gun laws, we just need to enforce the laws already on the books,” he said in a statement. “But the bill signed into law today undermines enforcement of existing laws that Congress passed to make sure the background check system had complete information.”

Groups like the National Alliance of Mental Illness have accused the Trump Administration of rolling back other Obama-era policies designed to help the mentally ill.

"In the U.S., it is easier to get a gun than it is to get mental health," said Angela Kimball, NAMI's acting CEO. "We need to flip the script. It should be easy — not hard — for people to get the mental health care they need."

Meanwhile, mental health experts accused Trump of focusing on mental illness to avoid taking politically risky steps like banning high-powered weapons like the ones that were used in the El Paso and Dayton massacres.

“These events are tragic, but are not predictable because many people have the propensity to perpetrate mayhem,” said Linda Teplin, a professor of psychiatry at the Northwestern University Feinberg School of Medicine. “They must have the weapons, not only the inclination. We are complicit because we make rifles with high capacity magazines available to all.”

The Newtown Action Alliance said the president's comments are an attempt to deflect from real change.

"If the president truly believed that those with mental illness should not have access to weapons of war, he would not have reversed Obama's executive order to remove social security recipients with mental illness from the NICS background system," Po Murray, Chairwoman, Newtown Action Alliance said in a statement. "But the fact is that only 4 percent of violent crimes are committed by those with mental illness. Donald Trump continues to push the NRA rhetoric that scapegoats mental illness in an effort to deflect from the real issue ... the dire lack of common-sense legislation that could end the epidemic of gun violence in our country."