The program’s origins date back to 1986, when G. Van Standifer, the town manager of Glenarden, Md., started the inaugural chapter in his city to keep young men off the streets on Friday nights.

The organization, then known as the National Association of Midnight Basketball League, soon expanded across the country, with chapters eventually opening in 50 cities. A 2006 study published in the Journal of Sport and Social Issues found that “cities that were early adopters of officially sanctioned midnight basketball leagues experienced sharper decreases in property crime rates than other American cities.”

But Douglas Hartmann, a professor of sociology at the University of Minnesota and one of the paper’s co-authors, conceded that the study didn’t tell the full story.

“We lacked the data to isolate Midnight Basketball as the cause of this,” Hartmann wrote in an email. “It was likely because Midnight Basketball programs were in cities that had more social intervention and crime prevention initiatives in general.”

President Bill Clinton earmarked $50 million to nationalize the program as part of his 1994 crime bill, but the funding was removed after the program was criticized by Republicans in Congress as “pork barrel,” as Senator Charles E. Grassley put it. By 2004, all but nine chapters had closed down because of funding problems.

Today, the organization is back up to 20 chapters, and few better encapsulate its mission than Oakland’s. The league fields up to 16 10-player teams for each eight-to-10-week session and operates on an annual budget ranging from $150,000 to $180,000, according to Howard Gamble, the league’s director. (The program’s two biggest sponsors are Kaiser Permanente and the Alameda County Probation Department.) On game nights, athletes receive jerseys and meals and attend life skills workshops in which guest speakers discuss conflict resolution, employment opportunities, probation, parole and more.

Oakland is grappling with increases in violent crime, triggered in part by the destabilizing effects of the pandemic, according to some criminologists (the Oakland Police Department investigated 134 homicides in 2021, the most since 2012). Midnight Basketball offers a blueprint for an alternative approach to crime prevention, through life coaching. Where the city’s systems have failed, locals have created their own support network.