Boston Mayor Marty Walsh cruised to a second term, defeating City Councilor Tito Jackson nearly two-to-one.

The lopsided result was foreshadowed by WGBH’s poll and others that showed voters with a high level of satisfaction with city life and in no mood to turn out Walsh. Jackson, who represents a Roxbury-based district, had never won election citywide and waged an underfunded, underdog campaign that never took off.

Unofficial results of the low-turnout election had Walsh with 65 percent to Jackson’s 34 percent. Jackson was the second African American to reach a mayoral final, and fared about the same as the first. In 1983, Ray Flynn defeated Mel King by a similar margin.

In his victory speech, Walsh tapped one source of his popularity, once again playing a foil to President Trump and his anti-immigrant policies.  

“Immigrants seeking a better life choose Boston, they risk everything to come to our city, and I will always have their back,” Walsh told cheering supporters at the Fairmount Copley Plaza Hotel.

It was just the message that Nicole Herendeen, a campaign volunteer, wanted to hear.

“I love how he wants Boston to be a city for all, and just open its doors and kind of make it a sanctuary city, especially what’s going on right now in the country,” Herendeen said.

During the campaign, inequality, affordable housing, schools and crime were some of the big issues. Walsh touted advances in those areas during his term, including the construction of new units of affordable housing, and a rise in the high graduation rate and a decrease in crime.

Looking ahead in his speech, Walsh promised to end chronic homelessness and offer free kindergarten to all children in the city. He was reelected to a four-year term. 

As he campaigned, Jackson took shots at Walsh’s record, charging, for example, the new housing units were not really affordable to many residents. He criticized budget cuts at struggling schools whose enrollment had declined.

Jackson conceded the race before supporters at a Roxbury restaurant. His campaign galvanized a diverse coalition that believes that Boston must do better by less wealthy residents.

The three-term councilor offered no apology for losing his long-shot bid. 

“I walk in here with my head unbowed," Jackson said. "I walk in here with pride, because this was never about me, this was never about Mayor Walsh — this is about the people of the city of Boston and their future.” 

Jackson said he does not know what is next for him once he leaves office in January, only that he plans to continue to serve his neighborhood.

Roughly a quarter of registered voters cast a ballot. That was down from 38 percent in 2013.