PHILADELPHIA — Sen. Bernie Sanders made a surprise visit Tuesday on Hillary Clinton’s “home turf,” addressing New York delegates at a breakfast and urging them to help his former rival defeat Republican Donald Trump in the presidential race.

“Our first task,” Sanders told New Yorkers, “is to make sure that Hillary Clinton is elected our president,” repeating his endorsement of Clinton at the Democratic National Convention the night before.

Sanders told Democrats not to be complacent about Trump’s chances. He called the brash billionaire the “worst Republican candidate in history.” He said what distinguishes Trump from other Republicans is that he’s a “demagogue” who doesn’t even understand the U.S. Constitution and who has built his campaign on “bigotry.”

“We have got to defeat and defeat soundly a candidate whose cornerstone, the cornerstone of his campaign, if you can believe it, is bigotry,” Sanders said.

The event appeared to be part of a Democratic strategy to follow up Sanders’ endorsement speech with an effort to build party unity. Sanders was introduced to the estimated 500 people in the crowd by Gov. Andrew M. Cuomo, a strong Clinton supporter who, during the primary elections, attacked Sanders on occasion. Cuomo, noting where Sanders was born, called him a “Brooklyn boy” and, rather than focus on Clinton-Sanders differences, Cuomo talked about areas of agreement, such as raising the minimum wage.

“Many of his issues and many of the points in his agenda that he fostered, we are living in New York,” the governor said.

advertisement | advertise on newsday

Cuomo applauded Sanders for running an “outstanding campaign” and said the Vermonter has kept “his eye on the ball.”

“The goal for the Democratic Party is to make sure Trump and that philosophy has no place in this country — ever,” Cuomo said.

The ballroom at the Loews hotel was filled with New York’s top Democratic brass — including Sens. Chuck Schumer and Kirsten Gillibrand, and several members of the state’s congressional delegation — as well as rank-and-file party members.

Sanders’ delegates gave him a standing ovation, waving Bernie signs and a cloth Sanders doll and shouting “We love you, Bernie!”

The surprise appearance, coupled with Sanders’ speech Monday, might begin to salve some “open wounds,” said Sanders delegate Jay Ballanca, a resident of Salem, northeast of Albany. But he cautioned that many party officials are pressing them to “fall in line, fall in line” and some Sanders backers are still unhappy about that. He said party leaders don’t understand that the Sanders faction “isn’t traditional” and doesn’t follow a typical political script.

More than Sanders’ urging, Clinton herself has to make an effort, he said.

“Hillary Clinton really has to make an outreach to them,” Ballanca said. “She hasn’t done that so far.”