Attorney General Jeff Sessions, in Boston yesterday, railed against MS-13 gang violence — saying Americans should be “free to walk down any street in this country without fear of being hacked by a machete” — and decried a rising homicide rate, both nationally and locally.

“I was really shocked to see the kind of murder increase you’ve seen this year,” Sessions told law enforcement officials at the John Joseph Moakley U.S. Courthouse in South Boston yesterday, straying briefly from prepared remarks.

Homicides in Boston for the year so far are up 26?percent — from 31?murders between Jan.?1 and Sept.?21, 2016, to 39 during the same time period in 2017, according to the Boston Police Department. The numbers in each year include two incidents that were declared homicides within the year though they were committed in previous years.

Annual FBI crime statistics, due to be released Monday, will show a national increase in murder, aggravated assault, rape and robbery, Sessions said.

“This is a frightening trend,” he said. “And it does threaten to erode so much of the progress that had been made in our neighborhoods and our communities.”

Overall, high-level crimes are down 6 percent year-to-date, according to the BPD.

“The BPD is continuing to strengthen our relationships and partnerships with our communities so that we may maintain this downward trend in overall crime, as well as prevent and solve homicides in our city,” BPD spokeswoman officer Rachel McGuire said. Mayor Martin J. Walsh’s office said in a statement, “Since 2014, violent crime is down 7%, property crime down 21%, total part one crime down 18%, all while arrests are down 36%. Our officers are working hard every day to address and prevent violence in the city.”

Sessions said the nation must continue a steady improvement in the professionalism of state and local law enforcement, which he credited for reducing the crime rate since the 1980s.

The former Alabama senator — berated mercilessly on Twitter earlier this summer by President Trump for recusing himself from the ongoing Russia election meddling investigation — also vowed to dismantle the MS-13 street gang “clique by clique and member by member.”

“We will find you,” Sessions said. “We will devastate your networks. We will starve your revenue sources, deplete your ranks, and seize your illicit profits. We will not concede a single block or street corner to your vicious tactics.

Sessions also praised the U.S. Attorney’s Office in Boston for the indictment of 56 MS-13 leaders, members and associates in January on federal racketeering conspiracy charges.

“It is precisely this type of law enforcement collaboration that is absolutely necessary — street-level intelligence and investigation, combined with federal partnership, remains a tried and true combination for successfully investigating and prosecuting this group of thugs,” Sessions said.

The Herald reported in April that the emerging East Side Money Gang is challenging the supremacy of MS-13 north of Boston.

Meanwhile, Sessions did not mention sanctuary cities or deliver any public message for city leaders such as Mayor Martin J. Walsh, who has vowed to turn City Hall into a shelter for illegal immigrants if need be.

Anti-Sessions protesters held signs outside the courthouse that read “Abolish ICE” and “Go Away! Racist Keebler Elf.”