A car drives past the entrance to the All Dulles Area Muslim Society (ADAMS) in Sterling, Virginia. The mosque won approval to build another location in Nokesville on Wednesday. (Paul J. Richards/AFP/Getty Images)

CORRECTION: An earlier version of this story incorrectly stated that Sister Joanna Burley implied that opponents of a mosque in Prince William County were motivated by Islamophobia. In fact, Burley said that she does not think traffic around the mosque site will be a problem. This version has been corrected.

On one side, impassioned Prince William County residents dressed in green shirts argued that constructing a new house of worship would disrupt their quiet community, choke the roads with traffic and go against the zoning regulations meant to protect the rural enclave.

On the other side, their Muslim neighbors said that all they wanted was a place to pray in their own community — and that opposition to their plans to construct a mosque might arise out of not just technical arguments about land use but also bias against Islam.

After hours of heated testimony on Tuesday night, which included 170 speakers and went past 3 a.m., the Prince William Board of County Supervisors voted to approve the mosque.

“We were kind of biting our nails and all that. But in the end, I feel like I could go another 10 hours,” Mohammed Iqbal, a member of the Muslim congregation All Dulles Area Muslim Society (ADAMS), said exultantly as he walked out of the meeting in the wee hours of the morning.

“We love U.S.A.; we love Prince William; we love Gainesville. And now we feel like we got what we deserve,” Iqbal said. “As a citizen, this is a proud moment. It’s really a proud moment for all of us. We migrated to this country with the notion that this is the best place in the world, and we find out this is the best place in the world.”

Iqbal and the others celebrating the workings of local bureaucracy early Wednesday morning at the county government center in Woodbridge are members of ADAMS, one of the nation’s largest mosques. The mosque already has permanent locations in Chantilly, Fairfax and Sterling, rents space from a synagogue in Ashburn and holds worship services in hotels in Arlington, Manassas and Vienna, among other locations, according to its website.

ADAMS bought a piece of land in Nokesville in Prince William County for $500,000 in 2014 to build its next facility. But the property is in the area of the county known as the Rural Crescent — a protected zone where single-family homes must sit on lots of at least 10 acres, most residents must use septic tanks, many raise livestock, and facilities like a religious institution require a special-use permit from the county supervisors. ADAMS sought a special-use permit, setting off a contentious fight.

The residents who lined up to tell the county supervisors why they supported or opposed the mosque on Tuesday night — beginning shortly after 7:30 p.m. and talking, one after the next, for more than seven hours — tended to focus on preserving the Rural Crescent. Even middle schooler Mateo lined up to say, “I’m only in seventh grade but I cannot imagine all the traffic in our rural community, with much smaller roads.”

“A good neighbor is one who, upon entering a new neighborhood, respects the rights of the existing neighbors, does not try to bully its way into special exceptions, and who is not attempting to affect change that will negatively impact the character of the neighborhood for its existing residents,” said Vickie Wilson, a resident of the area where the mosque will be built who testified in opposition to it along with her husband Jeff Wilson, the senior pastor at Bethel Evangelical Lutheran Church in Manassas.

Jeff Wilson said that he respects the desire of fellow people of faith for a house of worship near their homes. But the issue at hand, he said, was also “a question about preserving the Rural Crescent, upholding the laws of zoning or the covenant agreement with the people of the Rural Crescent.”

Other religious leaders spoke out in favor of the mosque.  “What I don’t understand is how exactly the mosque would destroy that sense of peace and that sense of something greater than one’s self in a rural area,” said Sister Joanna Burley, a nun in the Benedictine Sisters of Virginia. “I question the concern about traffic.”

When one speaker, Bill Cook of Haymarket, began his testimony by mentioning terrorism and Hamas and then alleging that many mosques in the United States are owned by an affiliate of the Muslim Brotherhood, dozens of people watching his testimony from the overflow seats in the lobby started booing.

The county supervisors eventually approved the special-use permit for the mosque as well as an exemption to let the mosque use a public sewer, not a septic tank. Corey Stewart, the chair of the board of supervisors, was instrumental in delivering the eventual 5-3 vote in favor of the sewer access.

Stewart has long made himself known for his forceful opposition to illegal immigration, and during his recent bid for the Republican nomination for governor of Virginia, which he narrowly lost, he ran in the inflammatory model of President Trump and spent much of his time defending Virginia’s Confederate statues.

But he also spoke frequently about the need for Virginia Republicans to get to know minority communities, and he has long had relationships in Prince William’s growing Muslim community. His embrace of Trump — whose campaign he worked for — disturbed some of those Muslim constituents.

“Corey Stewart made some unfortunate remarks during his most recent campaign,” said Nathan Mowery, a member of ADAMS. “However, he has demonstrated over his years being on the Board of County Supervisors that he is a friend and ally to the Muslim community here. He understands that we are patriotic Americans striving to improve our community. He’s made that clear to us.”

Early Wednesday morning, Stewart was on their side.

Fenit Nirappil contributed reporting.