The gunman who killed 7 and injured at least 22 others in a West Texas shooting rampage on Labor Day weekend before he was shot and killed by police was federally banned from owning or buying firearms after a court previously ruled he was mentally unfit to do so, authorities said.

The suspected mass shooter, Seth Aaron Ator, 36, appeared to have taken advantage of a loophole in federal gun law by purchasing the AR-type assault rifle used in the rampage at a private person-to-person gun sale, effectively bypassing a background check. Under Texas state law, background checks are not required in private sales, according to the Texas Tribune.

BEFORE MASS SHOOTING, TEXAS GUNMAN 'WAS ON A LONG SPIRAL DOWN,' INVESTIGATOR SAYS

Federal law mandates that after someone is “adjudicated as mentally defective” or is committed to a mental institution, their record must be sent to the FBI database known as the National Instant Criminal Background Check System in order to flag commerical gun sellers that that person may no longer legally purchase a firearm, The Wall Street Journal reported.

Sen. Chuck Schumer, D-N.Y., on Tuesday called on Senate Majority Leader Mitch McConnell, R-Ky., to bring a gun control bill passed by the House in February to the Senate floor for a vote next week. The proposed legislation aims at establishing new background check requirements for firearm transfers between private parties.

“If the House-passed background checks bill would have been signed into law, this tragedy could have been avoided,” Schumer said in a statement. “Leader McConnell—you have no excuse. The Senate must vote on the House bill next week—not a diluted bill, not a bill on other matters. We must take a vote on the House-passed bill to close these loopholes without delay.”

Officials defended the FBI database used to check the backgrounds of prospective gun buyers, as it appeared to prevent Astor from previously purchasing firearms.

"The background check was run through the National Instant Criminal Background Check System. The NIC system did work. He applied to get a gun. He was denied a gun," John Wester, a special agent for the federal Bureau of Alcohol, Tobacco, Firearms and Explosives, said at a press conference Monday, according to ABC News. Texas Gov. Greg Abbott, a Republican, added on Twitter that Astor did not submit to a background check before purchasing the rifle used in Saturday’s attack.

The database previously fell under scrutiny and was reviewed in 2017 after a gunman passed a background check and purchased a gun used to murder more than two dozen people at a Texas church. The Air Force never reported the gunman’s criminal history to the FBI in that case, according to The Wall Street Journal.

CLICK HERE TO GET THE FOX NEWS APP 

White House officials have been meeting with lawmakers and congressional staff to discuss the potential of pushing through new gun control legislation when Congress reconvenes from summer recess next week, The Wall Street Journal reported. President Trump applauded Texas law enforcement, first responders and the FBI in their handling of Saturday’s shooting. After back-to-back mass shootings at an El Paso, Texas, Walmart and outside a Dayton, Ohio, bar last month, Trump at times said he favors more meaningful background checks in gun sales but also stressed how mental health plays a role in mass shootings.