Someone was with Salvatore Marchese when he died of a heroin overdose, but no one called 911.

So his mother, Patty DiRenzo, a legal aide, began a quest to help make sure that others wouldn’t be afraid to make that call. She created a Facebook page, wrote New Jersey Gov. Chris Christie nearly every day and called all 120 members of the state legislature.

The grieving mother accomplished what would have been inconceivable a few short years ago, much less back when the nation launched its war on drugs: She helped pass a bill, signed by a Republican governor, that lets people get away with using drugs for the sake of saving lives.

The state’s new “Good Samaritan law,’’ which immunizes from prosecution people who call 911 to report an overdose even if they are using drugs themselves, is part of an emerging shift in the country’s approach to illegal drugs.

Four decades after the federal government declared war on narcotics, the prevailing tough-on-drugs mentality is giving way to a more nuanced view, one that emphasizes treatment and health nearly as much as courtrooms and law enforcement, according to addiction specialists and other experts.

The changes are both rhetorical and substantive, reflecting fiscal problems caused in part by prisons bulging with drug offenders and a shifting social ethos that views some drug use as less harmful than in the past. States are driving the trend. At least 30 have modified drug crime penalties since 2009, often repealing or reducing tough mandatory minimum sentences for lower-level offenses, according to the Pew Charitable Trusts, which works with states and tracks the legislation.

One-third of the states now have a Good Samaritan law, with the majority enacted since 2012.

That is the same year that Colorado and Washington became the first states to legalize recreational marijuana use. “There is certainly more momentum than ever before,’’ said Mason Tvert, spokesman for the Marijuana Policy Project, an advocacy group that expects that a dozen or more states are likely to legalize the drug within several years.

Change is also afoot at the federal level, where FBI data show drug arrests are down 18 percent since 2006, and the Obama administration tries to avoid the phrase “war on drugs.” The Justice Department is strongly supporting changes being considered by the U.S. Sentencing Commission that would reduce sentences for most drug offenders, and the Senate Judiciary Committee recently passed a bipartisan bill that would cut them in half for some drug crimes.

No one is suggesting that the fight against drugs is over. Federal agents are still battling traffickers on the southwest border, and the administration has taken aggressive steps against abuse of prescription drugs and other illicit substances. Polls show that even as a majority of Americans now favor legalizing marijuana, overwhelming numbers still oppose that step for cocaine and heroin.

And while many of the drug law changes have drawn bipartisan support, some prosecutors are opposing Attorney General Eric H. Holder Jr.’s efforts to eliminate mandatory minimum prison sentences for nonviolent drug offenders. The marijuana legalization campaign has also faced resistance from former Drug Enforcement Administration leaders and other critics.

But after a generation of anti-drug messages symbolized by the “Just Say No” campaign of the 1980s and enforcement accompanied by martial metaphors, experts say a broad consensus is emerging around a crucial distinction. Under the new paradigm, they said, traffickers engaged in the business of drugs will still face long prison terms, while lower-level users will increasingly be viewed as addicts with a treatable illness.

“States in particular are starting to make much bigger distinctions between personal use and commercial activity,’’ said Adam Gelb, director of Pew’s Public Safety Performance Project, who pointed out that some states have recently toughened penalties for large-scale drug sales while relaxing them for drug possession.

Douglas Berman, a law professor at Ohio State University and an expert on criminal sentencing, called the new landscape a strategic shift rather than a “retreat” from the anti-drug war. “We are retrenching,’’ he said, “and coming to the view that if we deploy our forces more effectively, that will allow us to win this war and take a healthier approach.’’

Era of tough enforcement

It was June 1971 when President Richard M. Nixon sent a special message to Congress and targeted drugs as America’s “public enemy number one.’’

“If we cannot destroy the drug menace in America, then it will surely in time destroy us,’’ Nixon said in the message as he called drug abuse “a national emergency” and established a White House office to attack it.

It was the start of what came to be known as the war on drugs, which emerged as a reaction to fear of crime and the perceived excesses of the 1960s. The crackdown escalated in the 1980s under President Ronald Reagan as Congress, with bipartisan support, established tough mandatory minimum sentences for marijuana and other drugs.

With aggressive enforcement, the number of people jailed nationwide for drug offenses exploded from 41,000 in 1980 to 499,000 in 2011, according to the Sentencing Project, a think tank that advocates criminal justice changes.

The first stirrings of reform came in a few states in the 1990s, and concern grew nationwide about perceived racial disparities in enforcement of drug laws.

It was the financial crisis that spiked in 2008, however, that accelerated the change, as cash-strapped states tried to reduce prison populations in part by modifying drug laws. Fiscal worries helped bring support from conservatives, a key development since Republicans had long pilloried Democrats as soft on crime.

In a seminal moment, Congress in 2010 passed a law reducing disparities in sentencing practices, which were punishing crack cocaine offenses far more severely than powder cocaine. The measure also repealed a mandatory minimum sentence — for crack possession — for the first time since the Nixon years.

But states and localities have led the way, including in the development of Good Samaritan laws. They have emerged, with strong bipartisan support, as a reaction to the prescription drugs epidemic, along with the surge in heroin use. Advocates say some people overdose and die because witnesses, who may be sharing in the drugs, are afraid to seek emergency medical assistance.

The laws generally provide limited immunity from prosecution, usually for drug possession or other lower-level charges, for witnesses who call 911 and for the overdose victims. More serious charges such as drug trafficking are generally not covered. The laws are now on the books in 17 states plus the District, according to the Trust for America’s Health, a public health advocacy group.

Much of the impetus has been provided by parents of overdose victims, often from suburban areas seeing more drug use who form support groups and use the Internet to honor their loved ones. Among them was DiRenzo, of Blackwood, N.J., a middle-class community outside Philadelphia.

Her son, Marchese, 26, had struggled with drug addiction since age 16. In September 2010, police pounded on DiRenzo’s door at 2 a.m. Marchese had been found behind the wheel of a parked car at an apartment complex in Camden, N.J., dead of a heroin overdose. Police told his mother that someone had been with him.

“No one called 911. No one tried to save him,’’ said DiRenzo, who learned months later of the state’s proposed Good Samaritan law and began her lobbying campaign. “I thought that if I could save other lives because of what happened to my son, then I’m on board.’’

DiRenzo was “relentless, in a good way,’’ said state Sen. Joe Vitale (D), a prime sponsor of the measure, signed in 2013. “This wasn’t some high-paid lobbyist telling us what he was told to say. This was real life, real experience, unfiltered, and it made a difference.’’

The treatment option

A year after New Mexico in 2007 passed the nation’s first Good Samaritan law focused on drugs, Ian Goodhew looked out the window of the Seattle courthouse where he had been sending drug offenders to jail for years. He could see new dealers and buyers taking their place on street corners just outside.

“Our prosecutions and policing weren’t making a bit of difference,’’ said Goodhew, deputy chief of staff for the King County prosecuting attorney’s office.

So Goodhew teamed up with a police official and defense lawyer to develop a novel pilot program. In part of the city, when police arrest someone with a nonviolent past for buying or selling small amounts of drugs, they now have the option of immediately sending the arrestee into drug treatment — and not pursuing the case.

“It’s the vanguard, a sea change in how law enforcement thinks about drug laws,’’ Goodhew said of the Law Enforcement Assisted Diversion program, which started in one neighborhood in 2011 and is about to expand to others. “This is treating the issue of low-level drug sales and use as a public health problem.’’

The program, which has also been adopted by Santa Fe, N.M., is considered among the most innovative of a variety of state and local changes to drug laws and policies that de-emphasize enforcement or combine it with more treatment. Among them is a Hawaii program that swiftly punishes drug offenders for probation violations and has been shown to reduce recidivism, along with the rapid growth of drug courts — special courts that emphasize treatment over incarceration. Drug courts started in 1989, and there are now nearly 3,000 nationwide.

Much as the focus on treatment would have been difficult to imagine several decades ago, so would the growing success of marijuana legalization. The use of medical marijuana, first approved in California in 1996, has spread to 20 states plus the District. And the historic ballot initiatives that led to recreational use in Colorado and Washington is prompting activists to push for similar initiatives in at least six other states.

Alaska has agreed to put legalization on the ballot in August.

But the effort is not without obstacles: a number of groups opposing marijuana legalization have sprung up.

“The pro-drug movement has the momentum so far because they have the money and have been able to confuse people about the damage that marijuana really causes,’’ said David Evans, special adviser to Save Our Society From Drugs. “This is not ‘Woodstock weed’ anymore. It’s very potent, very addictive and highly toxic,’’ said Evans, who vows that the battle will be joined even more in the months ahead.

Alice Crites and Scott Clement contributed to this story.