Boston Mayor Marty Walsh says he's concerned about Donald Trump's victory, but believes the country owes the president-elect a chance to lead.

In a post on Medium on Monday, Walsh wrote that Trump said things in his campaign that alienated and threatened people he cares about, including women, immigrants, gay, lesbian, and trans people, people of color, people with disabilities and Muslims.

"Those words angered me during the campaign, and they concern me greatly now that he has won," the mayor said. "I hope Trump takes seriously his pledge to move away from division and towards unity."

He added that like President Obama, he believes Trump deserves a chance to lead. He said he will work with the federal government on anything that makes life better for Bostonians.

But Walsh also said the city will not compromise its values.

"We will defend our friends, neighbors, and family members from any and all efforts to exclude them, harm them, or strip them of their rights," he said. "Boston is a city of inclusion, a city of compassion, a welcoming, diverse, global city. We'll stay that way."

While the road ahead seems uncertain, Walsh urged everyone to remain engaged by volunteering, serving in community organizations or getting involved in politics.

"Come what may, we'll show a way forward for the rest of the country as well, just as Boston has always done," he said.