Receive the latest politics updates in your inbox

One political era ended and a new one began Monday as Martin Walsh was sworn in as the city's new mayor, succeeding Thomas Menino, Boston's longest-serving chief executive, who retired after more than two decades in office.

"I will listen. I will learn. I will lead," Walsh said in remarks prepared for delivery at his swearing-in ceremony at Boston College.

The former Democratic state representative and onetime labor leader called Boston a city of courage, of champions and of big dreams, noting that he was once just a kid from the city's Dorchester neighborhood and joking that even his mother would be surprised at how far he had come.

In his prepared speech, Walsh, 46, outlined a series of broad policy goals, including improving public safety and ending "senseless gun violence." While noting that the 40 homicides in Boston last year were fewer than the year before, Walsh said the number was still too high.

"No parent should worry that a bullet will stop a daughter or son from coming home," he said. "No woman should be scared on our streets. No senior should be afraid in their home. And no child should be forced to live with the trauma and the indelible scars of violence."

Later Monday, as one of his first acts as mayor, Walsh planned to convene a closed public safety meeting that will include police and mothers of victims of violent crime.

Walsh also said in his prepared remarks that he would work to strengthen the economy and create jobs, improve the city's schools and increase transparency at City Hall, including new conflict-of-interest and personal financial disclosure rules for city officials.

Walsh thanked Menino, who first took office in 1993, saying his "legacy is already legend and his vision is all around us."

In his final morning as mayor, Menino planned to briefly visit City Hall before leaving for a vacation.

Menino, 71, who has battled health problems in recent years, opted against seeking an unprecedented sixth full term as mayor of New England's largest city. He plans, among other things, to teach at Boston University in the coming year.