SACRAMENTO — After months of heated negotiations and with California on the brink of insolvency, Gov. Arnold Schwarzenegger and legislative leaders have nearly completed a deal to erase the state’s giant budget deficit with a mix of tax increases, spending cuts and borrowing.

A vote that would end one of the most contentious and costly stalemates in state history is expected Friday.

Though details are still emerging, the plan to close the state’s $40 billion shortfall through mid-2010 includes a series of tax increases and program cuts, as well as a cap on state spending that would go before voters in a special election later this year. The proposal would raise the sales tax by 1 cent on the dollar, nearly double the vehicle license fee that motorists pay annually, increase taxes on gasoline by 12 cents a gallon and impose a 2.5 percent surcharge on personal income taxes.

Spending on most state programs — from public schools and universities to health and human service programs for the poor — would be cut by billions of dollars.

The plan would need to pass by two-thirds majorities in the Assembly and Senate, a hurdle that has frustrated negotiations for months. But GOP leaders indicated that they have lined up the minimum number of votes from their members to reach the two-thirds threshold.

The tax measures would be temporary and tied to the fate of a ballot measure curbing the growth of state spending. If voters approve the spending cap, the new taxes would remain in effect for five years; otherwise, they would go away after two years. That Republican-driven provision is meant to create a disincentive for Democratic interests to try to defeat the spending cap at the ballot box.

Senate President Pro Tem Darrell Steinberg, D-Sacramento, also indicated Wednesday that the package includes a tax break of at least several hundred million dollars for corporations with extensive out-of-state business. In a potential boon to the high-tech and biotech industries, it would ease the state tax burden for companies with significant sales outside California. Companies that operate exclusively within the state would not benefit.

Proponents say the break would make the state more inviting for large corporations to set up shop in, but critics counter that the state can’t afford tax cuts given the deficit.

In another concession to win GOP votes, the pending compromise includes some, but not all, of the environmental and labor concessions that Republicans sought, Steinberg said. While he would not offer specifics until the deal is formally announced, some ideas broached in the past included easing rules requiring meal breaks for workers in hourly jobs and delaying implementation of regulations to curb diesel emissions.

The plan relies almost equally on spending cuts and tax increases to close the deficit — $15.1 billion in cuts and $14.3 billion in new revenue — as well as $10.9 billion in borrowing. Funding for schools and community colleges would drop by $8.6 billion, by far the largest single spending reduction. Cost-of-living increases would be denied for welfare recipients and for the aged, blind and disabled; those savings, along with other cuts, would be more than $1 billion. And spending on state universities would be pared by $890 million.

The proposal would require state employees to continue to take off two Fridays a month without pay through summer 2010, and it would eliminate two of 14 paid state holidays. But the mass layoffs Schwarzenegger threatened this week would be avoided.

Voters also will be asked to approve borrowing $5 billion against future lottery revenue — an unpopular idea, polling shows. The state intends as well to take out a $5.5 billion loan, an uncertain prospect given the state of the credit markets.

If California receives enough money from the federal stimulus package approved Wednesday, the state would forgo the $5.5 billion loan. Officials also expect the federal money to alleviate the need for roughly $1 billion in proposed spending cuts and $1.8 billion in tax increases.

If the budget plan is approved, Santa Clara County’s sales tax rate would increase to 9.25 percent from 8.25 percent. Motorists would have to pay 1.15 percent of their vehicle’s value to the state each year, up from 0.65 percent currently. And prices at the gas pump would jump 12 cents a gallon.

Although both of the Democratic legislative leaders involved in the talks and a spokesman for Schwarzenegger all cautioned that a deal was not final, the remaining differences appear to be relatively minor.

“They are making progress; they’re getting close,” said Aaron McLear, the governor’s spokesman.

Steinberg said some “loose ends” still need to be resolved but that the parties had reached “a common framework.”

And the office of Assembly Speaker Karen Bass, D-Los Angeles, said in a memo that while leaders have made “enormous strides” toward a deal, “there is no final agreement.”

At least three Republicans in both the Senate and Assembly would have to vote for the package, risking a backlash among conservatives. All but one Republican lawmaker have signed a pledge vowing not to raise taxes.

Still, Senate GOP leader Dave Cogdill, R-Fresno, told fellow Republicans during a briefing Friday that the deal being negotiated isn’t going to get any better.

"There is a general recognition that we don't need these military-style weapons in New Zealand, so it's very easy to win cross-party support for this," said Mark Mitchell, who was defense minister in the previous, center-right government and who supports the ban initiated by the center-left-led Labour Party.