State lawmakers are coming to the aid of the financially embattled Oakland Unified School District, which is bracing for the effects of budget cuts over the next three years.

On Monday, Gov. Jerry Brown signed the Education Trailer Bill, which will provide financial relief to cash-strapped school districts across the state.

After hemorrhaging money for years, OUSD is facing a $30 million budget shortfall next year, and a $60 million deficit the year after that.

In June, the state Fiscal Crisis and Management Assistance Team also found that the district was using dubious accounting practices that, in some cases, amounted to a misuse of federal and state funds.

OUSD is set to receive millions of dollars in aid from the state, spread out over the next three years, provided that the district meets a number of obligations.

Funding from the trailer bill will cover up to 75 percent of the district’s estimated $30.3 million shortfall beginning next year, up to 50 percent the following year and up to 25 percent in the third year.

Each year it receives funding, the state and the Alameda County Office of Education will assess whether OUSD is adequately working to improve its fiscal solvency. The district will also have to consider consolidating schools, selling or leasing surplus property, growing its rainy-day fund and other measures.

The infusion of cash from the state won’t eliminate the district’s budget cuts, but it “will make these reductions more surgical and less draconian,” OUSD said in a statement announcing the funding.

Last month, the district announced it would be cutting half of its school sports programs in an effort to save around $500,000. Three of the sports were saved with donations from community members, but the cuts had a disproportionate impact on sports programs for girls.

“This partnership between the state and Oakland Unified is unprecedented, and I fully intend to take advantage of the opportunity to return our schools to fiscal vitality,” said Superintendent Kyla Johnson-Trammell in the statement.

Dominic Fracassa is a San Francisco Chronicle staff writer. Email: dfracassa@sfchronicle.com Twitter: @dominicfracassa