SACRAMENTO — Gov. Jerry Brown and California lawmakers on Monday reached a key agreement on K-12 education funding and other pivotal parts of the state’s spending plan, which could set up one of the smoothest paths toward a budget in years.

Brown got his wish to keep intact most of the cuts made in previous years while dedicating most of the money from a newfound surplus to bolster public schools, with a particular emphasis on disadvantaged students. Democratic lawmakers, meanwhile, chipped away at restoring a few parts of the social safety net slashed during the recession.

Brown and lawmakers led by Senate President Pro Tem Darrell Steinberg and Assembly Speaker John Perez reached the deal on Monday afternoon, five days before the full Senate and Assembly must approve the budget by a midnight Saturday deadline. A public announcement of the details is expected Tuesday.

The annual number-crunching debate no longer centers on whether the state’s books are balanced but how much of a surplus should be spent. Unlike the last several years, the budget is now balanced — largely because of cuts made in recent years, the $6 billion tax hike voters approved in November and the increased tax revenues that have come with the economic recovery.

Brown won perhaps the biggest battle — which was over how much money will be available to spend. Lawmakers agreed to use Brown’s $96.4 billion spending plan, $3.2 billion less than what the Democratic-controlled Legislature wanted. That means the state would have a better chance of avoiding red ink but that fewer social programs will get extra funding.

Legislative budget committee chair Sen. Mark Leno, D-San Francisco, and vice chair Assemblyman Bob Blumenfield, D-San Fernando Valley, both said at a legislative budget committee meeting late Monday that they agreed to Brown’s lower financial estimate “to reach a deal.”

“As all budgets are acts of compromise, this budget would be no exception,” Leno said, noting that if state revenues come in rosier, they could revisit boosting spending in January because “our safety net has been shredded in recent years.”

Brown and lawmakers had also spent the last two weeks debating how to dole out the larger pie of money to K-12 schools that came from the Proposition 30 tax hikes. The compromise would increase money to K-12 schools by $2.1 billion, compared with Brown’s original proposal of adding $1.6 billion, according to education consultant Ron Bennett.

School officials welcomed the news, partly because education might receive more state money — a reversal of a five-year trend of reductions — and also because the perennially tardy Legislature reached an agreement with the governor before its deadline.

“The fact they might be on the same page is a good sign,” said Stephen McMahon, chief business officer of the San Jose Unified School District.

While compromising at the edges, Brown appears to have gotten the three key reforms he sought: to simplify the antiquated and Byzantine formulas for funding schools; to inject more equity and justice into funding; and to shift control away from the state toward county and district levels.

“The governor is a very pragmatic guy,” said Kevin Gordon, who works as a Capitol lobbyist for school districts.

Instead of giving each school district separate pots of money for a variety of purposes, the state now will give districts one large chunk of money plus more for hard-to-educate students.

Schools will get more money for poor students, English learners and foster children; districts with concentrated poverty will get even more.

That will help out districts like Oakland Unified. “It’s a question of not only fairness but also a matter of economic competitiveness for our state,” Oakland Unified spokesman Troy Flint said.

But for districts like San Jose Unified, some of that extra money could remain out of reach. The district’s total of those three categories of disadvantaged students is 53 percent, McMahon said, just short of the 55 percent cutoff to qualify for the new poverty grant. Brown had wanted a 50 percent threshold but agreed to up that during negotiations.

Still, fattening the biggest pot of school funding has made suburban districts happier. “That was certainly our first concern,” said Terry Koehne, spokesman for the San Ramon Valley Unified School District. “There were definitely winners and losers in the original proposal.”

Although the budget compromise was hammered out early by legislative standards, it’s still late for school districts, which have been crafting their 2013-14 budgets since January and must approve them by July 1.

So the Oak Grove School District in San Jose, for example, will base its budget on per-pupil revenue of $5,291 — up from $5,000 this year, said Deputy Superintendent Chris Jew.

And districts remain cautious of more details yet to come, such as penalties for not reducing primary-grade class sizes, new oversight by county offices of education and whether the state will keep with past practice of not fully paying districts the funds it owes them.

“Until we get the details and the strings,” Jew said, “I’m a little leery.”

On social programs, there were more compromises. Steinberg, the Senate leader, and other lawmakers got their wish to spend $143 million in one-time funds on mental health programs and nearly $80 million to restore dental care for the poor starting in May, less money and a later implementation than what the Senate wanted. But the Senate lost its bid for an extra $50 million on Medi-Cal for children and another $32 million on nursing home programs.

The Assembly, meanwhile, secured extra funding for the CalWORKs welfare program and another $63 million will fund trial courts, less than the $100 million the Legislature wanted.

As the result of a measure approved by voters in 2010, the Legislature no longer needs a two-thirds majority to pass a budget — a simple majority will now do. Before that change was enacted, the state began its fiscal year in July without an approved budget in 10 of the 11 prior years.

Contact Mike Rosenberg at mrosenberg@mercurynews.com or 408-920-5705. Follow him at twitter.com/RosenbergMerc. Contact Sharon Noguchi at snoguchi@mercurynews.com or 408-271-3775. Follow her at twitter.com/NoguchiOnK12.