California lawmakers passed a $156.4 billion budget plan on Sunday that includes funding for a controversial high-speed rail project and preschool education for low-income children.

The vote, which came in ahead of the state’s constitutional deadline by less than six hours, followed months of political wrangling among Democrats seeking to restore spending on social programs cut during the recession. In the end the Assembly approved the budget 55-24 and it received a 25-11 vote in the Senate.

Gov. Jerry Brown called the spending plan a "solid and sustainable budget that pays down debt, brings stability to the teachers' pension system and builds at long last a reliable Rainy Day Fund," in a statement on Friday. He praised the legislators for crafting "a solid and sustainable budget" barely bigger than the $156.2 billion he had proposed in May.

He has until July 1 to sign the budget into law. Last year Brown used his line-item veto to kill some measures.

In the budget, Brown's high-speed rail project, a $68 billion effort opposed by Republicans, will receive $250 million in funding from the state's cap-and-trade program. The state collects a fee after polluters buy and sell their rights to emit carbon into the air.

As part of a compromise with Brown, lawmakers negotiated additional commitments for cap-and-trade funds, including money for affordable housing, mass transit and clean energy projects.

Other compromises included an expansion of public pre-kindergarten for low-income 4-year-olds.

Lawmakers also plan to include a requirement that $1 billion of education funds be used for specific purposes. They include implementing national Common Core curriculum standards, vocational education and assistance for school districts with a high percentage of disadvantaged students, said Assembly member Nancy Skinner, a Berkeley Democrat.

The budget also takes steps to address the shortfall in the teacher pension fund by increasing contributions from the state, schools and school employees.

Lawmakers had an incentive to pass the budget by the deadline. For each day they are late, lawmakers don’t get paid.

Al Jazeera and wire services