Updated Friday, March 23 at 1:30 p.m. to reflect that President Donald Trump signed the bill into law.

WASHINGTON — Texas Sen. John Cornyn's gun background check bill, filed in response to the Texas church massacre in November, was signed into law Friday under the government spending measure.

This is first gun measure approved by Congress since mass shootings in Sutherland Springs, Las Vegas and Parkland, Fla., renewed debates on gun control and school safety. Cornyn struggled to get the bill to the floor for a vote as a standalone measure after Democrats insisted on broader measures aimed at gun violence. Adding it to the spending bill paved the way for passage.

President Donald Trump tweeted Friday morning that he was considering vetoing measure, but backed down hours later and signed the bill.

The "Fix NICS Act" authored by Cornyn, the No. 2 Senate Republican, and Sen. Chris Murphy, a Connecticut Democrat, would penalize federal agencies that fail to report records and incentivize states to send criminal history records to the National Instant Criminal Background Check System. It has more than 75 co-sponsors in the Senate.

“The calls from the American people to address gun violence in our schools and communities have been deafening, and I’m grateful we’ll soon get that chance,” Cornyn said in a statement Wednesday after lawmakers announced that it would be included in the deal. “Fixing the background check system will help save lives and reduce the likelihood of what occurred in Parkland and Sutherland Springs from happening again.”

Cornyn and Murphy filed the bill after revelations that the Air Force didn’t send Sutherland Springs shooter Devin Kelley’s court-martial and conviction for domestic violence to the FBI database used to approve gun buyers.

Despite overwhelming support, including the backing of the National Rifle Association and the pro-gun control Brady Campaign, Fix NICS has taken months to get to the Senate floor. The House version of the measure was attached to a controversial bill that would allow gun owners to use a concealed carry permit from their home state anywhere in the country.

Cornyn had long argued against tying that provision to the background check bill, warning that it was too controversial and would hobble efforts to achieve progress that enjoys consensus support.

But Democrats and gun control advocates argue that the background check bill doesn’t go far enough to curb gun violence.

Democratic lawmakers had hoped to pass a congressional ban on bump stocks, rather than rely on an administrative ban from the bureau that regulates firearms. Bump stocks, the devices that allow a semi-automatic rifle to fire at nearly automatic rates, were used in the Las Vegas shooting. They also want to raise the age for all gun purchases to 21, a push that Trump seemed to back briefly when it was revealed that 19-year-old Parkland shooter Nikolas Cruz legally purchased an AR-15-style rifle a year before the attack.

Last month, Senate Minority Leader Chuck Schumer called on Congress to pass a universal background check bill, which would include private sales online and at gun shows.

"It is our hope that Republican leaders will help pass real legislation that makes a difference, rather than NRA-backed bills that make Republicans feel better without meaningfully addressing the issue of gun safety," said Schumer, a co-sponsor of the Cornyn-Murphy bill.

Now, the background check measure is included in the $1.3 trillion omnibus spending package that congressional leaders finalized Wednesday night and Trump signed into law Friday. The package includes partial funding for Trump's U.S.-Mexico border wall, and a 2.4 percent pay raise for military personnel.