Kicking off the political campaign season, Boston Mayor Martin J. Walsh denounced President Trump’s policies at Monday’s annual Labor Day breakfast, saying Trump has turned his back on working families.

But as he took aim at the White House, Walsh also had some choice words for union members who showcase their labor connection on the backs of their cars alongside Trump bumper stickers.

“Those union numbers stand for something,’’ said Walsh, highlighting the gains labor has made through the years. “They stand for health care; they stand for pensions and annuities; they stand for the rights and protections [of workers] . . . they stand for the people who came before you.”

Walsh, a Democrat and former labor leader, was among a short list of state political leaders who spoke at the annual gathering, held by the Greater Boston Labor Council. Before a packed ballroom, speakers called on unions to unify in opposition to Trump and fight to protect affordable health insurance and a higher minimum wage. They also voiced support for a federal program that shields unauthorized immigrants who came to this country as children from being deported.

Trump has signaled he will move to abolish the Deferred Action for Childhood Arrivals program, enacted in 2012 under the Obama administration.

“In 2012, we promised them the chance to live, work, and contribute to this country without being ripped away from the only home most of them have ever known,’’ Massachusetts US Senator Elizabeth Warren said at the event, held at the Park Plaza Hotel.

Craig F. Walker/Globe Staff

“America should keep its promises,” said US Senator Elizabeth Warren, Democrat of Massachusetts.

“Today they are in our schools, they are in our military, they are in our unions. We promised to protect the 800,000 DACA kids from deportation, and America should keep its promises,” she added.

Massachusetts US Senator Ed Markey criticized efforts to dismantle DACA but also slammed Trump’s other initiatives, including a plan to fund “his ridiculous . . . project” of a border wall near Mexico.

“We will not back down. They need to know that we are going to fight twice as hard,’’ said Markey, who said more needs to be done to improve women’s pay, curb the opioid crisis, and increase the minimum wage.

US Representative Joseph Kennedy III said Massachusetts is enjoying a strong economy, with low unemployment and industry leaders flocking to the state. By many standards, Massachusetts is an envy of the nation, he said.

But he warned against a “steady, systematic” campaign that is threatening to erode labor gains in Massachusetts, citing efforts that seek to curb overtime compensation and threaten disability insurance.

“You can’t claim to be the epicenter of the resistance and then ignore consequences of inequality . . . in your own backyard,’’ he said.

Craig F. Walker/Globe Staff

Mayor Martin J. Walsh greeted supporters outside the event.

Unions need to set aside their differences and unite against Trump, said Steven Tolman, president of the Massachusetts AFL-CIO.

“This is a time in history for organized labor to come together — because everything our forefathers fought for is under attack,’’ Tolman said. “The right-wing corporate CEOs have billions of dollars to throw against us. Our values are under attack in our courts and in the Legislature.”

The Labor Day event has traditionally been seen as a way to kick off a political campaign, and attracted a host of candidates for City Council and governor.

Before the event, Walsh was greeted by a large crowd of union members who hoisted his campaign signs and shouted “Marty! Marty!” Unions were instrumental in Walsh’s 2013 mayoral victory.

The Greater Boston Labor Council has endorsed Walsh for reelection.

In his speech, Walsh highlighted his administration’s achievements over the past four years and noted the role labor unions played in his life. Walsh said he had answered critics who questioned whether he would be beholden to labor.

“Leading with labor’s values never hurt us — far from it,’’ he said. “The city of Boston has never been in better shape.”

City Councilor Tito Jackson, who is running for mayor against Walsh, also attended the event although he didn’t deliver a speech. Instead, he shook hands and talked with those in attendance.

“Today what we heard is a recommitment to the men and women in the city of Boston,’’ said Jackson, who was planning a fund-raiser in Allston on Monday evening.

“We heard that we need to stand up for immigrants and we need to make sure that DACA is not repealed. We cannot stand idly by . . . we need to lead on those issues,” Jackson said.

Craig F. Walker/Globe Staff

City Councilor Tito Jackson, who is running for mayor, attended the breakfast but did not speak.