The Loudoun County School Board voted Tuesday night to grant conditional approval of an application to convert historic Middleburg Elementary School to a public charter program, setting the stage for what would become the first charter school in Northern Virginia.

A final green light to establish the charter program at one of the county’s oldest and smallest schools is ultimately conditional upon the successful negotiation of a contract and lease agreement for the century-old building, board members said.

The vote came at the end of a four-hour meeting that involved a detailed and occasionally heated discussion of the financial requirements needed to launch a successful program at the school. Board members sought to find common ground about lingering undecided issues — including an appropriate rate for administrative fees and the terms of a prospective lease with the applicants.

Middleburg Elementary, which serves a population of about 60 students, has been among the small schools repeatedly targeted for possible closing during annual school budget deliberations. Last year, that warning became more acute as the School Board was forced to trim an additional $16 million from its final budget at the direction of the county Board of Supervisors. Several board members, as well as outgoing School Superintendent Edgar B. Hatrick III, cautioned that the cost of operating Loudoun’s oldest and smallest schools could not be sustained for long.

In August, Middleburg Elementary parents submitted a formal request to work with the School Board to prepare an application for a charter program, with the hope that it could launch in time for the upcoming 2014-2015 school year. The School Board agreed in September to partner with the Middleburg Elementary community to prepare the application, allowing the proposal to bypass a preliminary state review that would otherwise be required.

If a final contract and lease is successfully ratified by the School Board, Middleburg Elementary would continue to operate under the Loudoun County public schools system, but would also be eligible for partial funding through grants and community donations received through a nonprofit organization.

Tuesday’s vote to grant the conditional approval of the application was unanimous among the School Board members present. Board members Jennifer Bergel (Catoctin) and Debbie Rose (Algonkian) were absent from the meeting.

“We have the first intention of moving forward with a charter school in Loudoun County,” School Board Chairman Eric Hornberger (Ashburn) said shortly after the 11 p.m. vote, to a burst of applause and cheers from the community members present. “Congratulations, everyone.”