SACRAMENTO — California drivers will pay more to drive in the state under a bill the Legislature passed Thursday to raise $52 billion from new taxes and fees to repair roads and bridges. That bill, SB1, will be sent to Gov. Jerry Brown, who has said he will sign it.

With a two-thirds majority threshold needed to pass the bill, Brown and legislative leaders worked hesitant lawmakers into the night, agreeing to award hundreds of millions of dollars for pet projects to earn votes. Brown has lobbied for the bill since he unveiled it with legislative leaders last week, saying it was the state’s best shot at creating a revenue source for California’s aging transportation infrastructure. The bill passed the Senate 27-11 with the minimum votes needed. The Assembly approved it with the bare minimum as well, passing it 54-26. Every vote cast in favor of the bill was from Democrats except one.

SB1 by state Sen. Jim Beall, D-San Jose, will generate

“I appreciate being a Democrat and what the Democrats did,” Brown said after the vote. “There is a reason why the members of the other party have been going downhill for so many decades. That’s because they are doing nothing. We did something to fix the roads of California.”

Legislative leaders looking to round up votes for raising gas taxes and car registration fees — both unpopular with the electorate — worked around a new state law approved by voters in November that requires the a bill to be made public at least 72 hours before a vote. The leaders were short on votes but unwilling to restart the 72-hour waiting period that would have been triggered if they had amended the bill. Last-minute bill amendments, such as to add earmarks to win support from reluctant lawmakers, have long been the practice in the Capitol.

Instead, legislative leaders added hundreds of millions in new spending to a budget bill — that will be voted on in the coming months — that benefits the districts of lawmakers who were on the fence.

That included $400 million requested by state Sen. Anthony Cannella, R-Ceres (Stanislaus County), to extend the Altamont Commuter Express rail line to Ceres and Merced and $427 million for projects in the Riverside County districts of state Sen. Richard Roth, D-Riverside, and Assemblywoman Sabrina Cervantes, D-Corona (Riverside County).

Brown called the added spending “arrangements” that he said would benefit the state.

“Getting a train going to the Central Valley?” Brown said when asked about the deal making. “Does anyone want trains more than me? No.”

Cannella, who owns an engineering company, also negotiated to have leaders support his bill to add indemnification protections for engineers and architects on government contracts. Roth, Cannella and Cervantes all voted for the bill.

Cannella was the lone Republican vote in support of the bill. Republicans railed against the bill, saying the state needs to prioritize transportation projects within the current budget instead of asking people for more money.

“Before we take a single dollar from Californians again and increase their taxes, we have a duty to make sure that we first are spending every dollar they send us the best we probably can and SB1 totally fails to do that,” said Assemblywoman Catharine Baker, R-San Ramon.

Under SB1, the state’s gas excise tax, which is currently 18 cents, will increase by 12 cents per gallon to 30 cents. The excise tax on diesel fuel, which is used by the commercial trucking industry, will increase by 20 cents a gallon to 36 cents. The diesel sales tax also will rise to 5.75 percent from the current 1.75 percent. Those increases will begin Nov. 1, while the vehicle registration increase will be effective

Jan. 1.

SB1 faced major opposition from environmental and health advocates, who said a provision in the bill giving the trucking industry a break from pollution regulations was not worth the trade-off for fixing roads and bridges.

Commercial trucking is a major source of air pollution, particularly in communities near ports, freeways or warehouses. The California Air Pollution Control Officers Association, which represents the state’s 35 air pollution control districts, wrote in a letter to lawmakers that they are concerned that the bill would limit the state’s ability to restrict truck emissions.

The trucking provision included in SB1 exempts truckers from any future state regulations that would require them to upgrade their trucks within the first 13 years on the road or before they reach 800,000 miles.

However, California Air Resources Board member Phil Serna said the agency’s air quality experts believe the bill will actually help antipollution efforts. Serna said other provisions in the bill ensure that when a truck is required to upgrade it becomes a condition of the vehicle registration beginning in 2020. He said that will significantly slash emissions in the state.

Agriculture groups pressured moderate Democrats and those who live in and around farming communities, saying the bill would lead to significantly increased costs for shipping produce.

Supporters also stepped up their lobbying, with Brown holding news conferences in the districts of undecided Democratic state Sens. Steve Glazer, D-Orinda, and Roth.

Glazer was the only Democrat to vote against the bill in the Senate. Assemblyman Rudy Salas, D-Bakersfield, was the only Democrat in the Assembly to vote no.

Sources said Glazer wanted the bill amended to include a provision prohibiting BART strikes, but the senator said he had many concerns with SB1.

“My constituents have told me loud and clear that they want any new taxes to be spent more wisely and effectively,” Glazer said in a statement. “For instance, it doesn’t make sense to spend billions of dollars on an unpopular High Speed Rail system that backers claim might be completed by 2029 when it could go for transportation improvements today.”

The Assembly had been seen as the harder-to-win house because of the number of Democratic lawmakers in swing districts where tax increases could make it difficult to be re-elected in 2018.

“We can’t kick the can down the road,” said Assemblyman David Chiu, D-San Francisco. “Today’s potholes are tomorrow’s sinkholes.”

Melody Gutierrez is a San Francisco Chronicle staff writer. Email: [email protected] Twitter: @MelodyGutierrez