Fearing what could be devastating fallout for Fairfax County, the Board of Supervisors voted unanimously Tuesday to set aside more than $8 million as a buffer against potential federal government cuts.

The board also approved a $9 million bailout for the county’s main social services agency, the Fairfax-Falls Church Community Services Board, which is struggling to meet higher demand as the economic downturn drags on. Had the board not done so, the only option would have been major cuts to programs for children and adults with mental illness, intellectual disabilities and substance abuse problems.

“We thought we were going to be getting out of this,” said Supervisor Penelope A. Gross (D-Mason), speaking about the slow recovery. “But it’s going to take a very long time.”

The threat of potential federal cuts, also known as sequestration, is looming especially large in Fairfax, where an overwhelming portion of the economy relies on federal jobs and contracts. Although the county gets only 1 percent of its general fund money from the federal government, the trickle down effects would be significant. In 2011, federal procurement contracts totaled more than $26 billion in Fairfax.

“We’re already seeing the impacts of sequestration with layoffs” at companies in the county, said Supervisor Pat S. Herrity (R-Springfield).

In approving the money for the Community Services Board (CSB), supervisors avoided a number of cuts that have alarmed families that rely on the agency. Among proposals that had been on the table for months were the closure of two residential treatment programs for mentally ill adults and girls, as well as reductions to a suicide-prevention hotline and programs for babies and recent high school graduates with intellectual disabilities.

“These are populations we just can’t let down,” board Chairman Sharon Bulova (D) said.

The decisions were made as part of an annual exercise known in most counties as the carryover review, in which supervisors allocate unspent money from the previous fiscal year and make adjustments to the current budget­ based on updated projections. Fairfax finished fiscal 2012 on June 30 with $40.6 million — a relatively small sum for a county that spent a total of $6.5 billion. Besides overestimating revenue by roughly 0.7 percent, the county spent slightly less than it predicted in some areas. Last year’s mild winter, for example, meant less money was needed for storm cleanup and employee overtime.

But that doesn’t mean Fairfax is swimming in cash; it is an indicator that the county over­estimated certain expenses and was conservative in projecting revenue, which is always the aim in drawing up an annual budget.

In other areas, though, such as at the CSB, spending ended in the red. Of the $9 million allocated Tuesday, roughly $2.6 million will cover a shortfall that remained from 2012. The remainder will go toward a projected gap of $9.5 million for this fiscal year.

Cuts will address the rest of the 2013 shortfall. The CSB has implemented a hiring freeze, and on Tuesday supervisors approved $2.4 million in further reductions, including to programs for preventing substance abuse and for the chronically homeless. No programs were eliminated altogether.

George Braunstein, executive director of the CSB, said that for the agency’s roughly 20,000 clients, the biggest impact will be longer wait times for services.

Overall, the CSB’s spending has grown in recent years, to $154 million last fiscal year from $141 million in 2009. Agency officials have blamed their inability to stay within budget on a handful of factors, among them a surge in demand in the wake of the recession, rising employee benefits costs and inadequate state and federal funding.

Some supervisors, however, have also pointed to poor financial management at the CSB, which gets about 70 percent of its money from the county but is overseen by its own administrative policy board. The county ordered an audit of the agency in June, the second in recent years.

Besides the CSB and sequestration, supervisors also doled out funding for county information-technology improvements, higher-than-projected employee benefits costs, and measures aimed at reducing speeding in neighborhoods. They put money into reserves for transportation and for potential legal expenses related to several pending lawsuits and tax challenges.

They also set aside money for next year’s budget, which officials expect to be much tighter than previously anticipated, regardless of potential federal cuts. County Executive Ed Long has asked all departments to prepare for 5 percent reductions in both fiscal 2014 and 2015.