SACRAMENTO  State lawmakers Friday overwhelmingly approved cost-driven changes to California’s vast public employee pension system that will reduce retirement pay for newly hired workers, from DMV clerks to school teachers to cops on the beat.

The pension deal was the hallmark accomplishment as lawmakers plowed through dozens of major pieces of legislation as they raced to a midnight Friday deadline ending the session for the year.

Going into the evening, lawmakers were weighing an assortment of tax increases, a repeal of the $150 a year fire fee on rural residents, a phaseout of plastic bags and an overhaul of how schools are ranked by test scores.

But it was the pension deal that was most high-stakes, affecting millions of state and local public employees across California.

“We are going further than any governor in the history of California. This takes pension benefits back to the Reagan era and maybe a little before. We’ve taken a great leap,” said Gov. Jerry Brown, a Democrat.

Brown has vowed to sign the measure, Assembly Bill 340.

New hires will have to pay more into the system and get less when they retire. However, it will not affect those working for the city of San Diego. The measure specifically exempts charter cities, such as San Diego, that are not part of the California Public Employees’ Retirement System. Those charter cities that are part of California Public Employees’ Retirement System, or fall under a 1937 state pension law, will have to comply.

San Diego voters in June passed Proposition B that establishes a 401(k)-style retirement plan rather than offering a defined pension for most new workers. Brown sought a 401(k) component to the state plan, but it was not included.

CalPERS estimates the savings at between $42 billion and $55 billion over the next 30 years.

The bill mostly targets new hires because Democrats say current workers have legal vested rights that cannot be overturned.

However, over five years as part of collective bargaining current workers must contribute at least half of the costs of their retirement. New hires will have to meet that obligation from day one.

Savings also come by requiring workers stay on the job longer. For example, new state employees could not retire until age 67 rather than the current 55 to qualify for full benefits. The retirement age for public safety employees goes to 57, from 50.

Another key component caps the amount of pay on which pensions are calculated at $110,000 (slightly higher for employees not covered by Social Security). The city of San Diego’s plan calls for a freeze on current pensionable salaries.

The measure also sweeps in local agencies, including schools that are part of the California Teachers Retirement System. San Diego Unified is one of those.

“We do not see that this will have any immediate impact on our near-term budget,” said Bernie Rhinerson, the district’s chief of staff. San Diego Unified is looking to the retirement systems for advice “to understand any longer-term implications,” he added.