At an hours-long meeting Tuesday that stretched past midnight, the Loudoun County School Board adopted a $911.9 million reconciled fiscal 2015 budget that spares several threatened schools, programs and services from cuts but leaves an uncertain number of jobs in peril.

The meeting brought an end to one of the most contentious budget cycles in recent memory, a months-long process marked by escalating tensions between School Board members and the county supervisors who had voted this month to adopt a budget that raised education spending but left the school system facing an estimated $37.7 million funding gap.

School Board members warned residents that the shortfall would require painful budget choices. The public responded with emphatic protests when the board announced that it would consider a series of controversial cuts, including closing four small elementary schools in western Loudoun; eliminating freshman sports teams; discontinuing bus transportation to Thomas Jefferson High School for Science and Technology, an elite magnet program in Fairfax County; and eliminating the school system’s sex education teachers.

These potential reductions were ultimately removed from the list of possible cuts. School Board members instead achieved substantial savings through deferring costs: A vote to hold off on purchasing 66 replacement school buses saved more than $7 million, and the decision to delay the implementation of a new salary pay scale until November trimmed almost another $6 million. Numerous new positions were eliminated, and plans for several highly anticipated new programs — including full-day kindergarten, an elementary foreign language immersion program and a musical theater magnet program — were scrapped.

Some existing programs were also canceled, including summer school and foreign language programs at elementary and middle schools. Those cuts put an undetermined number of jobs in jeopardy, school officials said.

Loudoun public schools spokesman Wayde Byard said it was too soon to know how many educators could lose their jobs. He said it is hoped that many would be reassigned to jobs elsewhere in the system. The schools generally have open positions as a result of retirement and attrition, and three new schools will also be opening in the coming fiscal year, he said.

“We’ll try to absorb as many people as we can into new positions,” Byard said. “We realize it’s very late in the year to be looking for a new job. Many of these people are longtime, loyal employees and we want to treat them right.”

School personnel staff members planned to work long hours this weekend to match the credentials of those employees with available open positions, Byard said. “They are going above and beyond to try to place these people,” he said.

Joey Mathews, president of the Loudoun Education Association, an advocacy group that represents thousands of public school employees, said the organization was concerned about the number of employees who might not be able to move elsewhere in the system.

“Hopefully, through attrition, through people retiring and new schools opening . . . all of these people can be fit in,” he said. “But a lot of times, when you have these [foreign language] teachers, that may be their only certification. So you could potentially have a large crop of teachers who will lose their jobs.”

Mathews said the organization hoped to see “more concrete numbers” from the school system in the coming week.

This year’s budget cycle was marked by particularly sharp division between School Board members — who said the school system needed $949 million to attract and retain talented educators, make up for deferred costs and keep pace with growth — and county supervisors, who made it clear that they intended to uphold campaign promises to keep taxes low.

Public hearings about the budget were dominated by speakers who wore red as a sign of solidarity and called on the county board to fully fund the School Board’s budget, even if that meant raising taxes. The supervisors adopted a budget that increased school spending by nearly $70 million but held real property tax rates steady.

The School Board’s frustration with that decision remained evident Tuesday.

“No one wants to be in the situation of having to make these cuts,” School Board Chairman Eric Hornberger (Ashburn) said during the group’s debate over the possible closing of Hillsboro, Aldie, Hamilton and Lincoln elementary schools. “We all recognize that. We didn’t choose this.”

Some supervisors have condemned the School Board’s response to its funding allocation. Supervisors Chairman Scott K. York (R-At Large) has referred to the School Board’s consideration of certain cuts — such as eliminating freshman sports teams and closing the four small elementary schools — as “emotional blackmail.”

In an interview with the Loudoun Times-Mirror last week, York continued his criticism of the School Board’s response to the county’s adopted budget.

“They have got plenty of money to keep current programming and open up the schools . . . and still give a 3 percent raise,” York told the Times-Mirror. “This is freaking ridiculous.”

Mathews said he hoped that next year’s budget process would involve less hostility on all sides.

“I hope that in the future, there can be a little more discussion earlier . . . even before the Board of Supervisors starts thinking about a tax rate,” he said.

He added that the level of public attention to this year’s budget process could set the stage for an interesting election next year.

“I saw more public input this year than I have ever seen before in Loudoun County,” Mathews said. “Those people are going to make their opinions known at the polls.”