Martin J. Walsh, a state representative who has been a champion of organized labor, will face off with John R. Connolly, a city councilor who promised bold leadership to transform Boston’s public schools, in the November final election for mayor.
The two men emerged as the two top vote-getters in tonight’s preliminary election. Walsh garnered 20,838 votes, or 18.5 percent, while Connolly received 19,420, or 17.2 percent, in final unofficial results posted by the Boston Elections Department, besting the 10 other candidates in the non-partisan contest.
The winner in the Nov. 5 final election will guide the city into the future, succeeding long-time Mayor Thomas M. Menino, who, after being beset with a series of ailments, decided not to seek a sixth term.
The preliminary election set up a return to the city’s tradition of having an Irish-American mayor, which had been broken by the 20-year reign of Menino, an Italian-American.
Walsh said in his speech at the Venezia Boston in Dorchester that he would “go to City Hall as a leader but also as a listener — a person who understands this city because I have lived it.’’
He asked his jubilant supporters to work with him to make Boston “a hub of opportunity.’’ and a place of “shared prosperity.’’
“I am very optimistic about where our city is headed, but I want to make sure all of us get there together,’’ he said.
Connolly, at his election night party at the Hibernian Hall in Roxbury, said, “I have never been more thankful to be in second place in my life.’’
He touted the diversity of his supporters and noted that many of them were parents with young children.“This campaign is the face of Boston and we are working together for Boston’s future,’’ he said.
“We think the future starts with safe schools, but it connects to the need for safe streets, healthy neighborhoods, and good jobs — and that’s what this campaign is all about,’’ he added after the speech in an interview.
Former city housing chief Charlotte Golar Richie came in third, collecting 15,536 votes, or 13.8 percent, followed by Suffolk District Attorney Daniel F. Conley, who received 12,674 votes, or 11.3 percent.
The 12 candidates ran a mostly civil race, campaigning tirelessly across the city for months. They participated in countless forums, shook innumerable hands, and plastered the city with their signs.
Walsh, 46, who lives in Dorchester, began serving in the state Legislature in 1998 and while there advanced in his work as a union official, eventually becoming the leader of the Boston Building Trades, an umbrella group that represents unions of ironworkers, electricians, and others. He resigned that job to run for mayor.
He’s known adversity in his life, struggling with cancer as a small boy and with alcoholism as a young man. He was grazed by a bullet one night in 1990 in an incident that he said wouldn’t have happened if he hadn’t been drinking.
Connolly, 40, who lives in West Roxbury, made waves when he voted against a Boston Teachers Union contract last year, balking at supporting a contract that didn’t ensure longer school days. He also ruffled feathers when he announced for mayor before Menino announced his retirement.
Just out of college, he taught school for several years before getting his law degree. He comes from a political family. His father was a long-time Massachusetts secretary of state, while his mother was chief justice of the state’s district courts. He was first elected to the council in 2007 and has been reelected twice.
Dan Conlin, a 23-year-old who works for the state Department of Revenue, voted this morning for Connolly at Holy Name Parish in West Roxbury.
“Growing up, one of the things that was important to me was education and he grabbed my attention with that,’’ Conlin said.
At the West Roxbury branch library, Judie Walsh, 64, said she wasn’t sure who she was going to vote for until she walked into the polling place.
She had narrowed it down to three candidates – Connolly, Walsh, and Conley.
“It was very difficult because they are such a good group, but I like everything about Walsh,’’ she said. “He just seems to connect with me more.’’
The other candidates in the race were City Councilor at Large Felix G. Arroyo, non-profit executive John F. Barros, radio station executive Charles L. Clemons Jr., City Councilor Rob Consalvo, City Councilor Michael P. Ross, Codman Square Health Center founder Bill Walczak, former teacher David James Wyatt, and City Councilor Charles C. Yancey.
Jim O’Sullivan of the Globe staff and correspondent Patrick D. Rosso contributed to this report.