A deal to raise tax collection estimates by more than $4.2 billion and spend nearly $48.1 billion in fiscal year 2022 came together Thursday with House and Senate lawmakers filing a compromise budget that would also make the state's controversial film tax credit permanent.

The budget deal, according to House and Senate officials, accounts for surging tax collections over the last six months that have far outpaced the projections agreed to by legislative leaders and the Baker administration at the start of the year.

The expectation of additional tax revenue was used by budget negotiators, in part, to create a $350 million trust fund that could be tapped in future years to help cover the cost of a $1.5 billion school funding reform law passed in 2019, known as the Student Opportunity Act.

The budget filed Thursday evening (H 4002) also reflects the decision of negotiators to cancel a planned draw on the state's reserves of at least $1.5 billion and proposes to make a supplemental deposit of $250 million into the state's pension system.

House Ways and Means Chairman Aaron Michlewitz and Senate Ways and Means Chairman Michael Rodrigues announced the compromise Thursday afternoon, and leaders in both branches hope to pass the budget on Friday and send it to Gov. Charlie Baker for his review.

Massachusetts is one of just four states in the country that started its fiscal year on July 1 and does not have an annual budget in place. Though the budget is already eight days late, the Legislature and Gov. Baker put in place a temporary budget totaling $5.4 billion to keep government operations funded through July.