Attorney General Jeff Sessions on Wednesday pledged aggressive criminal prosecution of drug dealers and gun-toting felons to combat what he described as a troubling rise in violent crime.

“I am determined that this country will not go backwards,” Sessions said as he addressed law enforcement officials in Richmond. “President Trump gave us a clear directive. It’s the policy of this administration to reduce crime in America, not preside over an increase in crime, but reduce crime.”

Sessions traveled to Virginia’s capital to highlight Project Exile, a two-decades-old federal program that gives felons caught carrying guns mandatory five-year prison sentences.

“The crime rate in our country remains at historic lows,” the attorney general acknowledged in his remarks. “But we’re beginning to see an increase again.”

He attributed that increase to less forceful prosecutions and lower sentences, a declining prison population and a growing opioid epidemic. He also said that “in this age of viral videos and targeted killings of police,” police officers in many communities were afraid to do their jobs.

The solution, Sessions said, is to “hammer” drug dealers and other criminals while bringing back the drug abstinence campaigns of the 1980s and 1990s.

“We have too much of a tolerance for drug use,” Sessions said. “We need to say, as Nancy Reagan said, ‘Just say no.’ There’s no excuse for this, it’s not recreational. Lives are at stake, and we’re not going to worry about being fashionable.”

Sessions scoffed at the idea, promoted by some doctors and researchers, that medical marijuana can be used as an alternative painkiller to prevent or treat opioid addiction.

“I’ve heard people say we could solve our heroin problem with marijuana,” he said. “How stupid is that? Give me a break!”

After his speech, Sessions told reporters he believed “medical marijuana has been hyped, maybe too much.” He added that his office may rethink parts of an Obama-era policy that largely allows individual states to legalize marijuana use.

Critics of Project Exile said the five-year mandatory minimum disproportionately affected poor black Americans. Sessions said he was “sensitive to these issues” but that most people in low-income African American neighborhoods want tough criminal penalties.

Recalling his own time as a prosecutor in Alabama, Sessions said that “the people in those communities pleaded with us to have more police and do a better job getting thugs off the street.”

Sessions’s visit came amid questions over Trump’s wiretapping claims and Sessions’s own communications with the Russian government.

Sessions told reporters he had not told the president anything that might back up the allegation that Barack Obama spied on Trump before the election. The attorney general has recused himself from that issue, he said, because of his involvement in the campaign.

The Justice Department asked this week for more time to turn over any information that might back up Trump’s claims.

Sessions said that he didn’t consider his meetings with the Russian ambassador to be “improper” because they didn’t discuss the campaign.

The appearance drew about 70 demonstrators, who gathered outside in the cold. They criticized Sessions’s record on civil rights and his failure to disclose contacts with the Russian ambassador during his confirmation hearing. “Sessions out of RVA!” and “No Sessions! No KKK! No fascist U.S.A.,” they chanted.

The group was joined by Lt. Gov. Ralph Northam, who is seeking the Democratic nomination for governor. He noted that neither he nor the governor had been invited, which he called “unacceptable.”

Inside, Sessions largely focused on prosecuting violent crime.

[Sessions greeted in Richmond by protesters]

The idea behind Project Exile, which was started to combat gang violence in Richmond, was to seize guns from people who were carrying them illegally and were most likely to use them in crimes. At the time, Richmond had one of the five highest per capita murder rates in the nation.

The program’s name came from the fact that, if convicted, a suspect would immediately be sent to a federal prison, often far from home.

During Project Exile’s first year, Richmond homicides declined 33 percent, and armed robberies declined 30 percent.

In 1999, the project’s second year, homicides declined another 21 percent.

But sentencing reform advocates have criticized the program, which was replicated in some other cities, such as Rochester, N.Y.

“It’s far from clear that Project Exile produced any of the benefits supporters attribute to it,” Kevin Ring, president of Families Against Mandatory Minimums, said in an interview. “That’s no surprise. One-size-fits-all federal programs don’t work, even in criminal justice. The American way of doing justice is making the time fit the crime, not giving the same cookie-cutter sentence to everyone.”

Ring said that national studies are mixed on the program’s results. Gun crime fell over the same period in cities that didn’t use Project Exile, he said.

Rep. Robert C. “Bobby” Scott (D-Va.), who has opposed Project Exile for many years, said the crime rate actually fell further in parts of Virginia that did not use the program.

“Everyone knows that mandatory minimums don’t work,” Scott said. “They have been studied extensively and fail to reduce crime and waste taxpayers’ money. . . . The only people they work for are politicians yelling at crowds trying to get a standing ovation.”

Project Exile continues, according to the Justice Department, but Sessions said the number of cases brought under the policy has been declining.

“This downward trend is going to end,” he said. “We’re going to attempt to bring more of those cases and exile people out of Richmond to some federal penitentiary for a while.”

Gregory S. Schneider contributed to this report.