The public scrap over who will serve as the next president of the Boston City Council was settled Monday, with the election of Bill Linehan, a district councilor from South Boston.

Despite an 11th-hour challenge by Councilor at Large Ayanna Pressley, Linehan won with an 8-to-5 vote, becoming the 53d council president since 1910, when the current system was created, according to a city archivist.

“You have given me this honor, and I am forever grateful; I will not let you down,” said Linehan, to thunderous applause.

With a new mayor and council sworn in Monday, Linehan promised to work closely with the administration of Mayor Martin J. Walsh, saying he will convene colleagues in the next two weeks to create a fresh look to the presidency and take new approaches to help improve communication between council and mayor.

Get Fast Forward in your inbox:

Forget yesterday's news. Get what you need today in this early-morning email.

The meeting Monday, held midday after Walsh’s inauguration ceremony at Boston College’s Conte Forum, featured a cameo appearance from the incoming mayor, who also pledged better collaboration with the council. Walsh promised transparency and said he wants to ensure that Bostonians are given every opportunity they need to succeed.

“I want to make sure that we work together on that so that every neighborhood in the city of Boston gets a chance to benefit from economic development, gets a chance to benefit from quality schools, gets a chance to make sure safety’’ is key, Walsh said.

Linehan, 63, a government worker for the past two decades, will succeed Stephen J. Murphy, the longest serving at-large member of the council who had held the presidency for three consecutive years.

The president is elected each year by a majority of the council. In addition to leading meetings and appointing committees, the president fills in as mayor if the mayor is out of state, incapacitated, or is removed from office. The council’s biggest legal power in city governance is approving or rejecting the mayor’s annual budget.

The council meeting began with District Councilor Charles Yancey of Mattapan presiding. The city charter requires that the longest-serving council member call for the election of the president. When Yancey asked for nominations, District Councilor Tito Jackson of Roxbury rose and asked for a change of rules to allow nominees to give speeches on their own behalf.

Pressley then stood and delivered a passionate speech, pointing to her track record representing the city and tackling what she calls contentious issues afflicting many Bostonians. Then she threw her hat in the ring. “Lord knows I do not have all the answers, but I do aim to actively seek them out by deliberation and prayer and to use my best judgment,’’ Pressley said. “Leadership is more than a mere title. It is the ability to empower people around common cause.”

When Yancey asked for other contenders to address the council, Linehan remained quiet. Then, the clerk asked each councilor to say whom they would pick for the post. The eight who named Linehan, including the councilor himself, were Mark Ciommo of Allston-Brighton, Timothy McCarthy, newly elected from Hyde Park, Frank Baker of Dorchester, Sal LaMattina of East Boston, and Councilors at Large Murphy, Michael Flaherty, and Michelle Wu.

In his acceptance speech, Linehan highlighted the experiences of the council, saying the members are skilled in governance, policy, and finance.

“We the council . . . offer this to our new mayor,’’ said Linehan. “It is my intention to work with each and every one of you to create an even better Boston City Council. We have a responsibility to those who came before us to improve this body.”

His victory comes after a contentious few weeks over who would hold the highest job on the council. Linehan had been vying for the position along with O’Malley, Jackson, and, later, Pressley.

Controversy erupted shortly after the mayoral election when O’Malley thought he could gather seven votes to claim the presidency. He had commitments from six councilors, including McCarthy, but Wu would not commit.

Things began to change quickly when McCarthy decided to back Linehan. Wu pledged her support for Linehan, and Jackson jumped into the ring, although he could not secure the seven votes.

Many Wu supporters, angry that the councilor appeared to betray her liberal leanings by backing a colleague they perceived as conservative and from an old guard of Boston politics, blasted her on Twitter, via e-mail, and in phone calls.

Wu stayed firm. She released a statement saying Linehan was the best person for the job.

Over the weekend,
the local chapter of the NAACP sent out e-mail blasts urging people to press their councilors to back Pressley, not Linehan.

On Monday, when Wu voted for Linehan, some audience members in the council chambers gallery grunted. And then there was applause.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.