After a week of hemming and hawing, the Boston City Council Wednesday adopted Acting Mayor Kim Janey’s operating and school budgets, which together are worth a bit more than $5 billion. The council acted after striking a last-minute deal with Janey, who greased the bargaining by adding $31.5 million in federal pandemic relief funds to satisfy council priorities. Each was approved by a vote of 10 to 2.

The largest chunk of money is budgeted for the city’s housing property acquisition program, which is intended to acquire designated properties before they can be scooped up by speculative developers.

Council Budget Chair Kenzie Bok, who the councilors playfully teased for working through the night to cut the deal, said it represents the first instance of the council wresting an additional funding order from the mayor as a compromise on financial priorities.

“Today, this council showed significant leadership and figured out a new way for us to get to ‘yes’ in a very difficult moment for the city,” Bok said after Wednesday’s council meeting.

Last year, when no extra federal dollars were on hand, the budget battle was bitter.

Councilors Andrea Campbell and Michelle Wu, both contenders for the mayor’s office, voted “no” on the operating budget, as they did last year.

“This isn’t political,” said Campbell, pointing to the optics of voting against her mayoral opponent’s spending plan. Campbell cited the lack of realized savings from last year’s attempt to cut police overtime and said she remains “wholly unconvinced” that the Janey administration’s plan to add more officers could effectively achieve a reduction.

“For me,” Campbell said, “this is about doing the job and making sure that you’re standing up, most importantly, for those who are unseen, unheard, and who do not feel as though their voice is given the weight it deserves in this process.”

Wu compared Janey’s budget to that of former mayor Marty Walsh and said it doesn’t “meet the moment.”

“It is a collection of smaller categories,” Wu said, “with seed funding in different places, that checks boxes on a lot of important categories. ... But in a moment when we need vision ... I can’t support checking the box on small initiatives without the plans to deliver that.”

Campbell and Dorchester councilor Frank Baker voted against the Boston Public Schools budget.

Campbell’s vote made it the third consecutive year she voted against the BPS budget, which, in her view, does not “go far enough” to close the district’s systemic inequities.

Baker was upset over the uncertain fate of school police officers, a side-effect of state-level police reform that suspends special officers licenses for lack of training.

The Dorchester councilor also expressed frustration over the intense focus on revamping the admissions process for Boston’s exam schools.

“We’re pitting neighborhoods against each other and, quite frankly, the neighborhoods that look like me look like they’re going to lose,” said Baker, who is white.

The exam schools became controversial on the council floor Wednesday after members of the BPS exam schools task force decried unexpected pressure that they said forced them to change their reform recommendation to the Boston School Committee the night before.

Several councilors denied that they were playing politics with the BPS budget over the exam schools. East Boston councilor Lydia Edwards, however, described such action as an appropriate use of the council’s budget leverage.

“We have one vote and that is on [BPS’] budget, so that to me is a form of accountability,” Edwards said, pointing to her leveraging her vote to secure funding for East Boston High. “The one time and the one way in which we speak with BPS, in this body, is a vote on the budget.”

At-Large councilor Julia Mejia said the situation illustrates the case for an elected school committee.

“How much longer are we going to allow political interests to come at the cost of our children’s education?” Mejia said. “So much of this BPS budget is going towards the things to try to repair the harm of decades of systemic racism…to put them at risk for political gain is dangerous.”

A four-year, $3.3 billion capital spending plan also passed with one councilor, Campbell, voting “present.” The capital budget is approved each year to fund long-term city investments such as infrastructure and facilities.

Clarification: This story has been updated to restore and clarify the unedited comments of Councilor Frank Baker.