As America emerged from the pandemic, communities continued to experience a rising tide of gun violence. School shootings and the rate of children and teens killed by gunfire both reached all-time highs since at least 1999. ProPublica’s coverage of gun violence reveals how first responders, policymakers and those directly affected are coping with the bloodshed.

Update, June 5, 2023: Texas Gov. Greg Abbott signed Senate Bill 728 into law on June 2, requiring court clerks to report involuntary mental health commitments of juveniles age 16 and above to the Texas Department of Public Safety for inclusion in the federal firearms background check system.

Texas lawmakers have closed a loophole in state law that allowed people who had serious mental health issues as juveniles to legally purchase firearms.

On Wednesday, the Texas House of Representatives voted 116-28 in favor of a bill that requires courts to report involuntary mental health hospitalizations of juveniles age 16 and older for inclusion in the federal gun background check system. The bill, which had already received unanimous support in the Senate, comes nearly a year after a ProPublica and Texas Tribune investigation revealed a gap in the law that required such reporting for adults but not for juveniles.

The passage of the bipartisan measure, authored by Republican state Sen. Joan Huffman, offers a rare example of gun-related legislation that has cleared the Texas Legislature since last year’s school shooting in Uvalde. It is now headed to Gov. Greg Abbott’s desk. Huffman could not be reached for comment. A spokesperson for Abbott did not immediately respond to an inquiry about whether he supports the bill.

“This bill will go a long way to ensuring that our state and federal databases are linked and that the process is more efficient and effective in keeping firearms out of the hands of dangerous Texans who do not need to have them,” Jeff Leach, a Republican state representative from North Texas, who sponsored the legislation said on the House floor. Leach represents the city of Allen, where a gunman killed eight people at a mall on May 6.

Currently, Texas law requires county and district clerks across the state to send information on court-ordered mental health hospitalizations to the Department of Public Safety. The state’s top law enforcement agency is charged with sending those records to the FBI’s National Instant Criminal Background Check System, known as NICS. Federally licensed dealers must check the system before they sell someone a firearm.

Elliott Naishtat, a former state lawmaker from Austin who authored the legislation in 2009, said he intended for it to apply to juveniles as well as adults. But an investigation by the news organizations found that local court clerks were not sharing that information for juveniles, either as a matter of policy or because they didn’t believe that they had to because the law did not explicitly mention them.

Further heightening the importance of closing the reporting gap, Congress passed gun reform legislation in June that includes a requirement that federal investigators check state databases for juvenile mental health records. Such checks would not show many court-ordered juvenile commitments in Texas because they are not currently being reported.

The Texas Judicial Council, which monitors and recommends reforms to the state judiciary, called on lawmakers to clarify juvenile reporting requirements after the ProPublica and Tribune investigation, stating that there was widespread confusion about them.

Pro-gun groups sought to extinguish the bill, arguing that it was a “red flag law,” a reference to laws that allow judges to order that weapons be taken from people who are deemed a threat.

The Texas Gun Rights group on its website called the bill a “Draconian scheme” that “discourages kids from coming forward to seek help for mental health issues by stigmatizing them and removing their Second Amendment rights for the rest of their lives.”

Leach has denied the bill represents a red flag law, arguing that it does not change any existing state or federal laws.

Texas law allows those discharged from court-ordered mental health services to petition the court that entered the commitment order to restore their right to purchase a firearm.

Other legislation sought by Uvalde survivors and family members, including a bill that would have raised the minimum age to purchase a rifle from 18 to 21, has been stymied in the current legislative session, which ends May 29.

Kiah Collier contributed reporting.