SACRAMENTO, Calif. (AP) — California lawmakers approved a state budget Wednesday that gives liberal Democrats long-sought increases to safety net programs while socking away billions to prepare for a recession.

The $122.5 billion spending plan, negotiated by Democratic Gov. Jerry Brown and Democratic legislative leaders, earned a rebuke from Republicans, who said it sets the state on course for deficits and fails to provide money to fix California’s crumbling roads.

The budget was approved nearly along party lines, with all Democrats and just one Senate Republican — Anthony Cannella of Ceres — in favor.

Democrats praised the budget as a significant investment in alleviating the harmful effects of poverty on children.

“It serves the people of California, I believe, with respect, dignity, appreciation and recognition of the challenges facing their lives,” said Sen. Mark Leno, D-San Francisco, the chairman of the Senate budget committee.

By law, about half the budget goes to K-12 schools and community colleges. A plan for much of the rest was agreed to last week by Brown, Assembly Speaker Anthony Rendon, D-Paramount, and Senate President Pro Tem Kevin de Leon, D-Los Angeles.

The budget still must be signed by Brown. A spokesman for the Department of Finance, H.D. Palmer, said the timing has not been decided.

Fearful of a looming recession even as swelling state revenues produce surpluses, Brown has fought lawmakers’ desires to increase spending on social services. But he relented on several measures that have long been a priority for fellow Democrats, agreeing to a big boost in wages for people who provide subsidized child care and to allow coverage for nearly 9,000 additional children.

He also agreed to repeal a provision of CalWORKs, the state’s welfare program, that prohibits additional state aid for children conceived while a parent is on welfare. Critics said the policy was based on racist stereotypes about welfare recipients. Brown gave in when they identified a long-term funding mechanism.

As the votes rolled in, Democratic senators hugged and fist-bumped Sen. Holly Mitchell, a Los Angeles Democrat who has dueled with Brown over the issue for the past four years.

Lawmakers also voted to increase funding for both California State University and the University of California, which will be required to enroll more California residents.

Brown won a commitment from legislators to pump $2 billion more than required into the state’s rainy day fund, which can only be accessed during times of economic distress. He also secured funding to renovate state buildings, potentially including the Capitol.

Republicans said the state won’t be able to keep up the long-term spending commitments. They echoed Brown, who warned when he released his own budget plan last month that deficits were on the horizon.

“The governor himself has said that (in) four more years, we could be faced with a $4 billion budget in the red,” said Sen. Jim Nielsen, R-Gerber.

Lawmakers failed to reach a deal on funding to fix crumbling roads and highways, which they have labeled as a top priority for several years.

“Not any more money is going toward transportation, to our crumbling road infrastructure. That is a glaring omission in this budget,” said Assemblyman James Gallagher, R-Plumas Lake.

Democrats say they’ll deal with road construction separately. They maintain it will require an increase in taxes or fees to generate sufficient revenue.

“It’s certainly not something we forgot,” Rendon said.

The budget also raises vehicle registration fees from $70 to $80 a year starting in April, to generate $400 million a year for the Department of Motor Vehicles, California Highway Patrol, Air Resources Board and other departments.

Brown and legislative leaders agreed to set aside $400 million for low-income housing, assuming lawmakers and Brown can agree on a plan to bypass construction review processes in certain neighborhoods. The policy has drawn strong opposition from neighborhood activists who fear it will allow developments that change the character of their communities.

Associated Press

AP writers Alison Noon and Darcy Costello contributed to this report.