US Senator Bernie Sanders spoke Monday at a rally in Someville in support of progressive candidates. Jessica Rinaldi/Globe Staff

SOMERVILLE — Senator Bernie Sanders, who came within two percentage points of winning the Massachusetts presidential primary last year, returned Monday morning to whip up progressives before next month’s election.

At an event supporting 18 local candidates who had received a progressive political organization’s endorsement, Sanders said Democrats are “embarrassingly bad” in midterm elections, urging a “political revolution” forged at the grass-roots level.

“What today is about is saying that at the local level, at the state level, at the federal level, we are going to demand and will succeed in creating governments that work for all of us, not just the 1 percent,” Sanders said, to applause, at the Once ballroom.

An outgrowth of Sanders’s presidential campaign, labeled Our Revolution, organized the event, where the former presidential candidate also assailed the budget that the US Senate passed last week, putting Congress on a path to a restructuring of the tax code.

“What’s in this budget is $1.9 trillion in tax breaks, 80 percent of them going to the top 1 percent, 40 percent going to the top one-tenth of 1 percent,” Sanders told a crowd of about 200. “And then, insanely, in order to pay for those tax breaks, they propose a trillion dollars in cuts in Medicaid, throwing 15 million people off the health insurance they have. That is beyond terrible.”

Sanders added, “Many thousands of people will die unnecessarily every single year, in order to give tax cuts to billionaires.”

A woman recorded Sanders as he spoke. Jessica Rinaldi/Globe Staff

Sanders targeted President Trump, saying, “He wants to divide us up. Our job is to bring our people together, to fight racism and sexism and homophobia and xenophobia. But simultaneously as we fight back against that effort to divide us up, we need a progressive agenda that speaks to the needs of working families all across this country.”

Sanders beat eventual Democratic nominee Hillary Clinton in Somerville with 57 percent of the vote, and took 53 percent in Cambridge.

Sanders on Sunday told the Concord Monitor that he would seek a third term representing Vermont in the US Senate as an independent, rather than as a Democrat, the party with which he caucuses in the Senate and under whose banner he ran for president.

On Monday, he spoke in favor of public funding for elections, boosting the minimum wage to $15 an hour, single-payer health care, and increased infrastructure spending -- all hot-button issues for the political left.

The fissures within the Democratic Party laid bare in last year’s primary remain in Massachusetts. One key Sanders supporter, Paul Feeney, addressed the crowd at the Once ballroom and lounge, saying in an interview beforehand, “All the people in this room are just trying to do everything they can to make sure we get good progressives elected.”

Former Cambridge mayor Ken Reeves, saying he had been a Sanders backer “since the inception,” said Democrats had suffered because Clinton’s message “was not inspiring.”

“I’ve been a Democrat my whole life, but the same-old, same-old is not working,” Reeves said after Sanders’s speech.

Democratic gubernatoral candidate Robert K. Massie also attended the event.

Sanders, the former mayor of Burlington, remains a widely discussed potential candidate for president in 2020, a favorite of the party’s left wing and voters disenchanted by more traditional politicians.

“We need to think outside the box of the current political situation right now,” said Vatsady Sivongxay, a candidate for Cambridge City Council who received the Our Revolution endorsement.

Sanders remains a widely discussed potential candidate for president in 2020, a favorite of the party’s left wing and voters disenchanted with traditional politics. Jessica Rinaldi/Globe Staff