He knew he was getting closer.

Detective Joe Murray started to feel confident about the attempted murder case he was building against Michael Lockhart, but there were still so many loose threads.

Single, with no children, he worked on the investigation even on his off days, which wasn’t unusual. When his father would pop into his son’s downtown apartment for a quick visit, he often found his son silently studying surveillance footage from one crime or another.

&nbps;

Murray had to figure out why Lockhart shot Lawrence Downs in broad daylight. The motive could help lead him to the identities of the other two gunmen, who were shown fleeing the scene in hazy surveillance footage.

But then the detective received an unexpected call from the Bureau of Alcohol, Tobacco, Firearms and Explosives. An agent there had a question for him: Are you investigating a guy named Michael Lockhart?

“Why?” Murray asked.

The next few words were shocking enough to knock him backward. Lockhart, Murray was told, was working for the bureau.

Murray had learned plenty about Lockhart since he was identified as one of the Downs shooters, but the detective didn’t see this coming.

Lockhart had sold numerous guns to the agency, pocketing thousands of dollars along the way.

The feds routinely turned people like Lockhart into assets. Some might start out selling a handful of weapons to an agent under the guise of getting guns off the streets. But guys in Lockhart’s shoes usually end up buying weapons or drugs for the ATF to help build cases against traffickers to work off their own legal woes.

It’s unclear how, exactly, Lockhart first ended up on the ATF’s radar, but the bureau came to view him as a valuable resource. Nationwide, the agency had more than 1,800 registered informants that it paid about $4.3 million annually. Like all other ATF informants, Lockhart was supposed to follow strict rules that he would not commit any new crimes and he had to sign an agreement acknowledging he understood the bureau would terminate its arrangement with him if he did so.

&nbps;

Murray realized Lockhart was more complicated than he’d first thought. But he’d seen people even in his own line of work dabble in elaborate deceptions. There were patrol cops who robbed drug dealers and sold heroin, and even a detective who tried to help his girlfriend get away with murder. Living a lie could be easy if you had enough practice.

Murray and his then-boss, Lt. John Walker, met with members of the ATF, along with Cydney Pope, a no-nonsense Philly assistant district attorney who prosecuted cases that came out of Southwest Detectives.

There were particulars to sort out: Should the feds take over the investigation? Was Lockhart the primary target, or should a bigger name like Jerry “Boog” Brooks be the main focus?

Left unsaid was whether the ATF had done any soul-searching over whether it had been a good idea to pay Lockhart to continue to traffic in the very things that had proven to be his downfall so many times in the past. “Guys like that are always teetering on a line,” Walker would later say. “Sometimes they jump over.”

A dose of unsettling news soon followed.

George Fetters, a detective in the Homicide Unit, contacted Murray about a case he’d just picked up. Fetters had been on the job for more than 30 years, and had worked with Joe’s father back in the 1980s and ’90s, when both were young cops in the Badlands of North Philly, tasked with tracking down murder suspects. Just hearing Fetters’ voice reminded Murray of how badly he wanted to be in Homicide.

&nbps;

Fetters only had bare-bones information. Someone had walked up behind a young guy on tiny Norfolk Street near 55th in West Philly in the wee small hours on Aug. 22, and shot him several times without warning.

Doctors at Penn Presbyterian Medical Center did what they could, but the victim didn’t make it. His name was Hassan Williams.

&nbps;

The murder scene was only a few blocks away from where Lawrence Downs had been shot. Perhaps, Fetters said, the two cases were connected. They had retraced Williams’ final steps. He was cut down just a few minutes after he stepped outside of an old watering hole on Baltimore Avenue, the Commodore Lounge.

Murray recognized the Commodore from digging recently in the Lockhart family files. On Oct. 1, 2008, Michael Lockhart’s father walked out of the Commodore and was shot 22 times by a man clutching an AK-47, supposedly over an old unpaid debt. The shooter, later identified as Jabok Timbers, is serving a 15- to 30-year prison sentence.

Whether the Downs and Williams shootings were linked at all was unclear to Murray. But the proximity of the two shootings — and the bar’s link to Lockhart’s father — made Murray think more about his family history, and the possibility that some of this bloodshed was fallout from a seven-year-old slaying.

&nbps;

It had been 11 days since Lockhart stole three guns from Jerry “Boog” Brooks, the head of a small West Philly drug gang, and blamed the theft on Williams, Downs, and another man, Kashif Love. One was dead, and another was paralyzed. What would happen to the third?

The longer it took Murray to get Lockhart in custody, the more likely it seemed that somebody else would end up riddled with bullets.

Still, he wanted to move carefully. Lockhart tended to be armed. It didn’t seem wise to try to grab him in North or West Philly, in neighborhoods filled with children. So Murray reached out to the ATF with a small request: Could the feds ask their asset to come in for a meeting?

Around lunchtime on Sept. 11, 2015, Lockhart made his way to the U.S. Custom House, an elegant, Depression-era art deco building at Second and Chestnut Streets in the heart of Philadelphia’s historic district.

The Custom House mostly attracts travelers who need to obtain passports, but the ATF occupies office space there, too. Lockhart headed to a small conference room on the second floor, and made some small talk with a few agents. For all he knew, this was just a conversation about the next handful of guns he might help them take off the streets.