BOSTON — The Massachusetts Senate has passed a $41.5 billion state budget for the fiscal year that starts July 1, setting the stage for negotiations with the House over a final version of the spending plan.

According to an analysis by the Massachusetts Taxpayers Foundation, senators added $75.5 million in spending through amendments during three days of debate before unanimously approving the budget early Friday.

Senate Democratic leaders say the budget invests in health care for low income residents and provides nearly $143 million for substance abuse treatment, including five new recovery centers.

Perhaps the most controversial amendment approved was one that would sharply limit cooperation between law enforcement officers in Massachusetts and federal immigration officials.

Republican Gov. Charlie Baker has indicated he would veto the provision if it reached his desk.