In an unwelcome role reversal, San Jose, which has long touted itself as one of the country’s safest big cities, saw street violence continue a recent ascent over the past year while Oakland and San Francisco trended in the opposite direction.

The Bay Area’s largest city was on track for a 7 percent rise in violent crimes — homicides, aggravated assaults, rapes and robberies — in 2017, according to the San Jose Police Department, which will have finalized numbers by mid-January. That follows a 14 percent jump the city recorded in 2016.

San Jose has some company both in the region and throughout the state. Cities like Berkeley, Hayward, Fremont and Palo Alto saw violent crime surge in 2016, and projections for 2017 indicate their rates have remained elevated. Los Angeles saw violent crime rise at about the same rate as San Jose. All are well out in front of the FBI-calculated national increase of about 4 percent from 2016.

“We’ve got a lot of work to do,” San Jose Mayor Sam Liccardo said. “It doesn’t matter that we’re still among the safest large cities in the nation. We see a rising trend of violent crime, and we have ample reason to be concerned and respond immediately.”

Start your day with the news you need from the Bay Area and beyond.

Sign up for our new Morning Report weekday newsletter.

It’s worth noting that scale matters: Palo Alto for instance, appears on track for a 5 percent increase in violent crime. But its numbers are small enough — 73 incidents in 2016 — that a half-dozen assaults can produce a notable percentage increase.

Oakland drove down its violent crime rate in 2017 by 5 to 6 percent. But with a population of 420,000, Oakland on average records 1½ times as many violent incidents as San Jose, a city of 1 million. San Francisco records roughly the same number of violent crimes as Oakland, but spreads that over 850,000 residents, and is on track to mark a 10 percent drop in violent crime for 2017 after a 7.7 percent drop the year before.

Although violent crime has inched up nationally, the overall violent crime rate in the United States has dropped by more than half since the early 1990s, according to the FBI and Bureau of Justice Statistics.

Liccardo hopes the infusion of 150 freshly graduated police officers, with more on the way, will help stem the problem in San Jose. But he also references his city’s acute issues with rising youth crime, gang-influenced or otherwise, fueling his push to bolster teen-employment programs like San Jose Works, which he says puts city youth on “a path to build a résumé rather than a rap sheet.”

“We need to be providing carrots to more kids,” Liccardo said, “but we also need a firm stick, and I’m hearing from too many officers that they’re arresting juveniles on serious and violent felonies, only to see them released and back out in the community the next day.”

If Liccardo is tapping this drumbeat, San Jose police Chief Eddie Garcia is the guy in the back of the marching band furiously banging a mallet against his bass drum. The youth crime issue stuck in his craw in November upon the arrests of a juvenile crew suspected in a string of carjackings and robberies highlighted by an 11-year-old suspected getaway driver.

Fatefully, as 2017 drew to a close, a 17-year-old East San Jose boy was stabbed to death late Thursday.

Get breaking news with our free mobile app. Get it from the Apple app store or the Google Play store.

Mario Maciel, superintendent of the Mayor’s Gang Prevention Task Force who directs many of the city’s youth-intervention programs, said the juvenile crew case encompasses a new trend of young offenders who commit crimes typically associated with street gangs, but actually carry no such affiliation.

“I’m seeing some nontraditional groupings,” Maciel said. “These kids are organizing on the internet to commit a rash of robberies. They make a series of hits in a weekend, then disband. They may not be in a traditional gang, but their additional activity has added to the uptick.”

Garcia noted that in 2017, his department reported that violent crimes with juvenile suspects jumped 42 percent. He echoes the mayor’s worry about a dearth of effective deterrents.

“I’m all for making sure the right people are incarcerated, but it seems like that’s tougher and tougher,” Garcia said. “We’re not talking about petty crimes. We’re talking about major adult violent crimes.”

The chief, in the face of his city’s battle with street violence, spent much of the year speaking out against voter-mandated measures aimed at decreasing the state’s prison population, which he says unfairly stick local law enforcement with supervising prison parolees. Plus, he says, more lenient sentencing guidelines have created a judicial blind spot allowing previously violent offenders to roam the streets if their most recent offense was deemed nonviolent.

“The pendulum has swung way too far,” Garcia said. “There has to be a balance between safety and the rehabilitation of the offender. Don’t put it on the backs of law enforcement and the community.”

Like our Facebook page for more conversation and news coverage from San Jose, the Bay Area and beyond.

Tom Hoffman, one of the architects of Proposition 47, which downgraded felony classifications for a series of drug possession and petty theft crimes, sympathizes with police agencies. But the former West Sacramento deputy police chief who oversaw state parole in the late 2000s asserts that incarceration can no longer be a reflexive penalty.

“I thought like they did until I was head of state parole,” Hoffman said. “We have to begin to respond differently to nonviolent crimes, especially those that have to do with a separate core cause like homelessness, drug addiction or unemployment. We have to be thoughtfully realistic about the world we find ourselves in. We can’t lock up everybody.”

Hoffman noted that $103 million in grants was made available this year for mental health and rehabilitation programs, derived from savings gained when thousands of people were spared prison time under Proposition 47.

“Change is never easy for cops,” Hoffman said. “We were all about arresting people and putting people in jail, and we were good at it. Now the world has changed. This very discussion is important to have.”

The debate highlights how, in many ways, the fight against crime “is all about perception,” said Greg Woods, a lecturer in the Department of Justice Studies at San Jose State University.

“What we have in California is a bucking of the national narrative, and a tough-on-crime approach might be warranted,” Woods said. “But if it’s just the prison population decreasing while the (county) jail population increases, we’re just playing musical chairs.”