Killings in the Bay Area’s biggest cities plunged by one-third in the first half of the year, a trend that puts the region on pace to possibly see less bloodshed in 2018 than it has in decades.

The reasons behind the drop-off — driven by gains in San Francisco and Oakland as well as Vallejo and Antioch — are difficult to pin down, according to police officials and criminologists. But the change is unmistakable.

It’s also consistent with broader, long-term decreases in homicides and violent crime in California and around the country since the brutal decades of the 1970s, ’80s and ’90s.

Through the end of June, police in the 15 most populous Bay Area cities recorded 84 killings, down from 122 in the same period in 2017, according to a Chronicle analysis.

In the past 20 years, the lowest number of homicides the 15 cities have seen in a single year is 220, in 2001. The high during the period came in 1998, when the cities were besieged by 438 slayings.

Some of the most dramatic improvements have been in San Francisco, which had 20 killings in the first six months of 2018 — down 41 percent from the 34 homicides during the same period last year. From 2004 to 2008, San Francisco averaged 93 homicides a year. There were 129 in 1993 alone.

“We’ve certainly noticed that gun violence and homicides are down fairly significantly from last year,” said Cmdr. Greg McEachern, who heads the San Francisco police investigations bureau. “I’m very optimistic, but you always have to be cautious. There are a lot of things that could change.”

McEachern attributed the drop in killings in part to recent measures by the police force, including shifting resources to centralized investigative units, increasing community engagement, forming a new unit focused on seizing guns, and solving more homicides.

The department is in the unusual position of enjoying a 112 percent homicide clearance rate for 2018. That means the cases it has closed this year — including cold cases from previous years — exceed the new killings. The Police Department typically solves 50 to 70 percent of homicides, McEachern said.

“By taking offenders off the street, there is less potential for them to commit crimes,” he said. “But it also lets families know we haven’t forgotten about their cases, and it has helped more people come forward. We couldn’t do it without the increased cooperation of the community.”

In October, the department created a gun unit tasked with getting firearms off the street, and the results have been promising. In the first half of 2017, San Francisco police took 460 guns off the street. So far this year, officers have collected nearly 700 guns, officials said.

Other police agencies have also shifted their focus to firearms. In Fairfield, police last year began a program offering $500 cash rewards for tips that lead to gun seizures, said Lt. Greg Hurlbut. Homicides fell from five during the first half of 2017 to two in the first half of this year.

“We aggressively go after any kind of firearms violations,” Hurlbut said. “We figure if you don’t have a gun, it makes it a little more challenging.”

Community groups have also played a major role in the effort to reduce homicides and other violent crimes in the Bay Area. Local leaders say gains often come after years of intensive work.

“This is not something that just happened overnight,” said John Nauer, street outreach manager with San Francisco’s Street Violence Intervention Program. “It took a lot of years, and we’ve been at the table with a lot of city departments. We’re not solving all the problems, but we’re preventing a lot of stuff that could have happened.”

Members of the program regularly visit the city’s high-crime hot spots, reaching out to young people who face pressure to engage in criminal behavior, Nauer said. Advocates go into schools, and crisis response workers respond to homicide scenes to seek calm and help victims’ families.

“We make sure there is no immediate retaliation,” Nauer said. “Some folks can make phone calls and de-escalate things.”

San Francisco was far from alone in reducing homicides. Oakland saw 31 murders through June, down from 33. The city suffered through 145 homicides in a calendar year as recently as 2006.

Antioch had only one homicide through June, compared with four last year. Vallejo’s first-half number dropped from 10 to two.

The numbers bolster studies that show California’s sweeping criminal justice reforms of the past seven years, which have sought to keep more lower-level offenders out of jails and prisons, have not fueled violent crime.

Sarah Ravani and Evan Sernoffsky are San Francisco Chronicle staff writers. Email: sravani@sfchronicle.com, esernoffsky@sfchronicle.com Twitter: @SarRavani @EvanSernoffsky