Emmett Jolley pulled up to the intersection near his northeast Houston home one spring night 14 months ago when the gunfire began.

A hail of bullets riddled his gray Nissan, striking him and a passenger sitting next to him.

The gunman fled moments later, leaving police to pick through the crime scene and bag the shell casings he'd left behind.

Miraculously, Jolley and his friend survived, victims of one of the thousands of gun crimes that plague Houston every year, and one that easily might have gone unsolved in years past.

This time, however, investigators had a weapon of their own - the National Integrated Ballistics Information Network, a revamped ballistics testing program run by the Bureau of Alcohol, Tobacco, Firearms and Explosives.

The bureau has pumped millions of dollars into the program to help local law enforcement make faster and better use of the federal database, creating joint investigative task forces with police in cities most prone to gun violence.

It gives police the clues they need in just days, not months.

"We're looking for a particular gun," said Art Peralta, assistant special agent in charge at ATF's Houston Field Division. "When we find that gun, we're usually going to find the person responsible for pulling that trigger."

Using NIBIN, investigators gained a valuable clue in Jolley's shooting: a ballistics match with a bullet casing from an attempted robbery just three days earlier.

The evidence helped pin the case on 17-year-old Timothy "Dough-Boy Ru" Grimes, an acquaintance who apparently thought Jolley had insulted his girlfriend.

Grimes' guilty plea earlier this month marked the first conviction in Houston using the retooled NIBIN database, part of a new effort by ATF to help local police get trigger-happy criminals off the street.

In the 18 months since the ATF launched the retooled program, NIBIN has generated dozens of leads that led to 20 arrests. Investigators linked one weapon in another case to six different shootings and connected another gun to a known drug dealer they say killed a horse.

"We're going to solve crime sooner, bring criminals to justice sooner, and more often," said Police Chief Art Acevedo. "When we do those things, we're going to ultimately prevent future crimes and save lives."

'Our flashlight'

Gun violence leaves a deadly toll in its wake across Houston annually.

More than 400 people died in the Bayou City from guns in 2016, including 259 homicides and 160 suicides. Gunmen committed 5,457 aggravated assaults with a firearm.

And Houston law enforcement leads the state - by far - in the recovery of firearms. Police seized more than 5,400 guns in Houston in 2015, twice as many as in Dallas and San Antonio, according to the most recent federal data.

In years past, slow ballistics testing left dangerous criminals on the streets for weeks or months while investigators waited for evidence.

Since the same firearms often are used repeatedly - even by different people - tracking the gun can identify an active shooter before another crime is committed. In Memphis, for example, NIBIN linked 30 percent of cases to guns that had been used more than once.

"Those are shooters, the worst of the worst," Peralta said. "NIBIN is our flashlight - it's not going to be able to see the whole room, but it will give us the ability to focus in on specific things."

The database allows firearms experts to match high-resolution photos of marks left on bullet casings after being fired. The guns' firing pins leave a mark unique to each gun, allowing investigators to connect casings fired at different shootings.

Turning NIBIN into the crime-fighting tool agents envisioned, however, didn't go as ATF leaders initially hoped.

Twenty years ago, ATF equipped hundreds of law enforcement agencies and crime labs with ballistic imaging machines and began compiling photos of casings collected at crime scenes or test-fired from guns seized in investigations.

Whipsawing budgets, disinterest and poor implementation at the local level, however, hampered NIBIN's impact on helping stop gun crime.

The problems left some gun cases unsolved, giving repeat shooters more time to wreak havoc. Bodies piled up.

"The right answer, late, doesn't help the investigators any more than the wrong information on time - they need that information quickly," said Ramit Plushnick-Masti, with the Houston Forensic Science Center, an independent lab that tests casings for the Houston Police Department.

Speeding up the clock

After an external study four years ago found slow turnaround times were hobbling NIBIN's effectiveness, ATF pumped millions of dollars into the program, forming task forces across the country with local police agencies.

The agency began urging investigators to collect all shells found at a scene - even if no one was hurt - so they could be entered into the database, increasing the chances of finding future matches.

"The ability to get hits is not linear," said William King, a Sam Houston State University criminology professor who has studied the NIBIN system. "The more you put in, the more you produce. The lesson is, everything needs to go in."

ATF also began encouraging local law enforcement departments and crime labs to test casings more quickly. Treating minor gun crimes as future homicides helps cut down on violence, said Ron Nichols, NIBIN's former national technology coordinator.

"If we can get timely intelligence to investigators with respect to these different shootings and what is occurring in the streets, there's potential to get an active shooter off the street before a homicide actually occurs," he said.

Since its inception, the NIBIN database has produced approximately 75,000 "hits" linking two or more crimes together.

"You only get NIBIN hits off repeat gun use," King said. "You get them off the street. ... That's huge value-added."

Lisa Meiman, a spokeswoman for the Denver Field Office, said the agency focuses on links rather than arrest totals because arrests misrepresent the impact of the system.

"Catching one suspect using NIBIN means solving multiple shootings," she said.

The Denver office was one of the first where ATF launched a gun crime task force. Houston's came two years later, in 2015.

In concert with the intelligence center, the Houston Police Department and the city's crime lab have taken other steps to speed up gun crime investigations.

Two months ago, Acevedo ordered his department to prioritize bullet cartridge testing. Previously, officers had to wait a week for technicians to test cartridges for latent fingerprints or DNA, but such tests are rarely successful, said Darrell Stein, the Houston Forensic Science Center's firearms section manager.

The faster turnaround from NIBIN has helped provide better intelligence for investigators, officials said.

"If you get NIBIN hits, and you don't go and have good people to go out and aggressively pursue what that hit provides in terms of leads, then you might as well not have it at all," Acevedo said. "We wanted to speed up the clock."

Investigators now are getting leads from shootings that took place just 48 hours earlier.

Other local and state departments also are expanding their efforts to beef up their use of the database.

Montgomery County, which currently sends cartridges to Houston's lab once a week, hopes to acquire a ballistics imaging machine soon. ATF plans to put an imaging machine and deploy two of the bureau's investigators from Houston to work with the San Antonio Police Department.

Headed to prison

Darrell Stein the Houston Forensic Science Center Firearms Section manager, demonstrates the a federal database known as the National Integrated Ballistics Identification Network used to track guns being used in violent crime by comparing matches with a bullet casing, Tuesday, April 18, 2017, in Houston. less Darrell Stein the Houston Forensic Science Center Firearms Section manager, demonstrates the a federal database known as the National Integrated Ballistics Identification Network used to track guns being used ... more Photo: Marie D. De Jesus, Houston Chronicle Photo: Marie D. De Jesus, Houston Chronicle Image 1 of / 10 Caption Close Stopping gun crime 1 / 10 Back to Gallery

Grimes walked into a Harris County courtroom earlier this month, a year after his outburst of gun violence in northeast Houston.

His arrest offers a blueprint for how authorities might tackle gun crimes in the future.

After investigators sent the abandoned shell casings off for testing, the Houston Forensic Science Center photographed the cartridges and ran them through the NIBIN database. They learned the shooter had used just one gun - but two types of ammunition - in the attempted robbery and the aggravated assault.

By the time officers identified Grimes and searched his home, the firearm was gone. He said he tossed it into a sewer. They did, however, find a pair of sweatpants like ones they'd seen in surveillance video taken from the attempted robbery.

He eventually confessed, authorities said, telling investigators he had supplied the gun in the attempted robbery and acted as the lookout.

He finally agreed to plead guilty to one count of aggravated assault and another of aggravated robbery.

Jolley could not be reached for comment. Grimes' attorney, Michael Trent, declined to comment.

But two weeks ago, Grimes trudged to the front of the 183rd Harris County District Court to admit to his crimes, knowing he faces 12 years in prison at his sentencing next month.

State District Judge Vanessa Velasquez peered down at the glum teen.

"Are you pleading guilty because you are?" Velasquez asked him.

His answer was almost lost in the shuffle of the courtroom.

"Yes."

Editor's Note: This story has been corrected since it originally was posted. The title for Lisa Meiman was changed to note that she is a spokeswoman for the ATF Denver Field Office.

Matt Dempsey contributed to this report.