The Prince William Board of County Supervisors unanimously voted on Tuesday to eliminate a long-standing practice of using surplus office funds to contribute to outside organizations, a system critics said gave supervisors a political perk using taxpayer money.

Prince William’s eight supervisors are each allocated about $350,000 annually to hire staff and pay office expenses. But thousands of dollars are often left over at the end of the year and, since the 1990s, supervisors have used a portion of those funds to donate to nonprofit groups, charities, schools and other organizations in their districts.

Those donations have also led to public accolades that many have argued give them an edge in local races where turnout is low and the value of incumbency high: recognition at community events, campaign-style advertisements placed in programs and listings as donors on popular community organization Web sites, for example.

Under the measure, proposed by Supervisor Pete Candland (R-Gainesville), supervisors will still be allowed to use any unspent dollars on approved infrastructure projects — such as roads or libraries — in their district. Otherwise, unspent dollars will go back to the county treasury. They are also allowed to use the money to buy single tickets to events when it’s part of their “official duties.”

Ending what some critics had called supervisors’ “discretionary funds” and “slush funds” brings the county more in line with other Northern Virginia jurisdictions that fund nonprofit and community organizations through their annual budget process, instead of having individual politicians hand out donations.

Supervisors and critics of the system said that worthy nonprofit groups deserved the money but that the process allowed for the appearance of impropriety. For example, when Supervisor Maureen S. Caddigan (R-Potomac) donated $1,000 this year toward the Boys & Girls Club, she received a table at the organization’s “Steak ’n’ Stake” fundraising dinner. She spent an additional $300 from her account on a full-page ad in the program.

The system “was more of a liability than it was a benefit,” Board Chairman Corey A. Stewart (R-At Large) said in an interview after the meeting. “I’ve wanted to get rid of them for a long time. It doesn’t look right.”

About 15 county residents — many affiliated with the Republican Party or tea party groups — said the system needed to be changed.

Michael High, a Gainesville resident, used an overhead projector to show how donations from supervisors’ accounts led to public recognition on Web pages and event programs.

“It’s pretty clear to me that taxpayer dollars are being used for political purposes,” High said. “Stop treating the taxpayers’ pot of gold as if it were a personal piggy back.”

Supervisors worried about the effect on nonprofit groups and charities that had received funds.

“There are dozens of nonprofits who rely on our contributions . . . to provide essential services,” said Supervisor Frank J. Principi (D-Woodbridge).

Many of the activists who attended the meeting were pleased with the results.

“We finally, after years and years, fixed the discretionary funds,” Greg Letiecq, a conservative activist and blogger, said after the meeting.

Tom Whitmore, a member of the county’s Republican committee, also said he was satisfied — if still a bit skeptical.

“They can still do it in the [regular] budget process,” he said of supervisors finding ways to receive personal benefits from taxpayer dollars. “This just closed one door.”

Supervisors also made several changes to the way they run their district offices.

First, supervisors reduced the amount they’ll receive for office funds by $20,000, a suggestion from Supervisor Martin E. Nohe (R-Coles). Supervisors then passed a series of amendments, offered by Supervisor John D. Jenkins (D-Neabsco), that prohibit overtime pay for supervisor staff and the hiring of family members, among other changes.

Candland said in an interview that he was “extremely excited” his measure on the supervisors’ accounts passed: “It’s a long time coming.”