Gov. Charlie Baker signed a bill Monday that allocates nearly $4 billion in federal relief and the state budget surplus.

After months of debate — and a particularly contentious missed deadline ahead of the Thanksgiving holiday — billions of dollars will be distributed across the commonwealth. The governor made one noteworthy line-item veto: cutting what he called “red tape” in the bill that would have changed the process for distributing bonus pay to frontline workers.

So how will the money be spent? The American Rescue Plan Act and state budget surplus spending package includes nearly $300 million earmarked for specific projects, but the biggest benefactors can largely be grouped into health, economic recovery, housing and the environment. The undercurrent through the bill is an equitable pandemic recovery that doesn't ignore infrastructure needs.

The buckets are largely the same as Baker’s ARPA spending proposal from the summer, said Doug Howgate, executive vice president at the Massachusetts Taxpayers Foundation.

“What’s different is, I would say, an enhanced focus in mental health and public health and health care providers,” he said. “On the flip side of that, you see less relief for infrastructure and housing.”

Here’s the breakdown.

Health

Of the billion dollars going toward public health and healthcare, by far the largest single sum is for mental and behavioral health: $400 million. Investments will be made in community treatment centers, repaying student loans for mental health professionals and “co-response” programs in which mental health clinicians respond to emergencies with law enforcement.

Senate President Karen Spilka has been pushing for expanded behavioral health services, sending a bill to the House that she said would bring nearly 2,000 more clinicians to the state. “We really, really have a responsibility in this moment to ensure that every resident of the commonwealth has equitable access to mental health care, no matter who they are, no matter where they live,” Spilka said in early November.

Networks and specific institutions will also directly receive hundreds of millions. Struggling hospitals will receive $250 million, and another $200 million will go to regional health systems — nearly $100 million of which is earmarked for improving hospitals’ data systems.

Tens of millions are also devoted to supporting healthcare professionals at a time when Massachusetts hospitals are short staffed. Massachusetts’ nursing facilities will receive $50 million toward workforce retention and capital improvements.

The fundamental idea of what is underneath the “public health” umbrella expanded time and time again in the pandemic. Line items that might have been seen as infrastructure or education in the past now live closer to the public health realm. Additional line items include:

  • $100 million for improving ventilation and indoor air quality in the state’s public schools;
  • $49.3 million earmarked for public health–related projects, including $1 million toward a hotline for mental health services, $1 million for a senior center in Lynn, $300,000 to develop a domestic violence shelter in Attleboro and $200,000 for children’s mental health services in K-12 schools in Boston;
  • $5 million for the nonprofit Health Care For All for vaccination outreach, education and access.

Economic recovery

The most direct efforts to mend the commonwealth’s economy come in adding more funds to unemployment benefits, the bonus pay for essential workers, grants for small businesses and investment in training the workforce.

The first billion dollars can be found in just two line items.

$500 million goes to replenishing the unemployment fund in Massachusetts, which could be in billions of dollars of debt after last year’s damage to the economy. It’s a point of conflict with business leaders: Baker previously proposed $1 billion, and Republican gubernatorial candidate Geoff Diehl called on the governor to veto the bill over the lower amount. There’s “no doubt” the fund will need to borrow money from the federal government in order to keep the unemployment fund afloat, Labor and Workforce Development Secretary Rosalin Acosta said Friday. (Another option would be to raise the level of tax employers pay into the fund.)

Another $500 million will be put into a fund for frontline essential workers, distributed as direct bonus pay for their work through the pandemic. Though the Legislature included the formation of a commission to distribute the funds, the governor struck that — his only change to the bill — saying that other agencies could adequately distribute it. He criticized the item last Thursday, telling reporters that there’s a “lot of red tape baked in there.”

Businesses Open During Pandemic
FILE — A sign on Newbury Street business in Boston reads "we are open" and "masks required" during the COVID-19 pandemic on Oct. 8, 2020.
David L. Ryan Boston Globe via Getty Images

A pool of $75 million will go to grants for small businesses to support their recovery from the pandemic.

Hundreds of millions more will be spent on workforce development, spread across several line items, including:

  • $107.5 million for career technical skills training;
  • $100 million for vocational high schools and other technical education programs;
  • $24.5 million for the YMCA and Boys and Girls Clubs related to workforce development;
  • $15 million to support “high-demand workforce training programs,” which Massachusetts’ community colleges, in part, get to decide how to spend;
  • $2.5 million toward specific workforce development programs, all broken out into earmarks for particular organizations.

Housing

With record-high home prices across Massachusetts and affordable housing being a top concern in Boston's mayoral race this year, the Legislature responded with more than $600 million in funding for projects across the state.

$230 million goes to the construction of new affordable housing: $115 million for units to be sold, and another $115 million for renting.

Another $150 million will create more permanent supportive housing for groups such as domestic violence survivors and chronically homeless individuals. At least $20 million of that will go specifically to long-term care for veterans, now served by the Soldiers’ Home in Chelsea and the Holyoke Soldiers’ Home. (An early COVID-19 outbreak at the Holyoke Soldiers’ Home led to 76 deaths and sparked investigations into the facility’s mismanagement.)

But it’s not all about new developments. One bulky line item goes to fixing up public housing: $150 million for infrastructure updates, such as heating, water and sewer upgrades and flooding prevention.

Some goes more directly to homeowners, or potential homeowners. $65 million will go to programs devoted to down payment assistance, financial literacy and more, specifically for communities disproportionately impacted by the pandemic.

And an additional $22.2 million is earmarked to specific housing projects, such as $1.3 million for improvements to Natick’s public housing and $200,000 for Arlington to acquire affordable housing units.

Environment

Climate change stars in several of the line items — and lurked in the background of others.

The largest chunk is $100 million for climate preparedness, with just over $13 million earmarked for specific projects. Initiatives such as restoring coastal areas, clean energy projects and flooding mitigation efforts all fall under the catch-all category, which can be distributed by governments and non-governmental organizations.

But not every line item nods to the changing climate as directly. Offshore wind and port infrastructure are set to receive $90 million. Water and sewer infrastructure, too, will get $100 million for efforts to improve water quality.

Other environmental causes will also benefit, with smaller sums going to projects that include:

  • $25 million for forestry and tree planting;
  • $15 million for land conservation;
  • $6.5 million for a pilot program to make low- and moderate-income housing buildings more energy efficient;
  • And $14.6 million for environmental cleanup and resiliency projects, most of which is directed to cleaning up the General Chemical plant in Framingham.