The Assembly approved a nearly $100 billion budget Tuesday that curtails a record deficit by slashing spending, raising fees and relying on borrowing, but still leaves the state facing a big spending gap next summer.

The compromise plan approved in the House's longest session ever now goes to Gov. Gray Davis (search), who said he will sign it. Analysts say the Democrat, who faces a historic recall election (searchin October, could get a boost in the polls with a budget plan in place.

The proposal avoids raising sales and income taxes, but counts on a $4 billion annual car tax increase that state officials triggered earlier this year and the elimination of a tax break for manufacturers.

After more than 27 hours of negotiations, the budget bill passed 56-22. That was enough to give the proposal the two-thirds majority required to pass.

"It's not pretty but it could have been a whole lot uglier," Davis said. "It is far from perfect but further delay was unacceptable."

The budget trims the state's record deficit that could have mushroomed to nearly $40 billion by next July, Davis said. Instead, the shortfall will be about $8 billion by next summer.

The governor said he will appoint a task force of business and financial experts to make recommendations to the state on how to fill that gap.

The proposal largely protects education funding for the next year. Public health and human service programs are also expected to be maintained at the same levels as last year.

The plan uses a complex tax swap that allows the state to borrow nearly $11 billion to help bridge the state's revenue shortfall.

But because lawmakers could not agree on imposing deeper cuts or raising more revenue through taxes, they delayed for at least a year a decision on how to deal with part of the deficit that could reach $8 billion by next summer.

Speaker Herb Wesson, a Democrat, apologized to Californians for failing to pass a budget sooner and said the compromise would cause heartache and hurt.

"This is a bittersweet moment for me. I'm glad we've climbed this mountain," Wesson said. "But I'm very saddened by the millions of people we will affect by not moving forward on this budget on a balanced approach."

Republican Leader Dave Cox claimed victory, saying his party was "able to get a budget that didn't increase taxes for Californians. It was a victory for our side."

Because spending has far outpaced tax collections in a slumping economy the past two years, officials forecast earlier this year that California taxpayers would face a $38.2 billion deficit by next July if aggressive steps were not taken.

Passage of the budget should ease Wall Street investor concerns but it's not likely to change the state's low credit rating. Last week Standard and Poor's, one of the country's most influential rating agencies, downgraded California's debt to one notch above junk bond status (search).

The budget deal came only a few days after the effort to recall Davis qualified for a special election this fall. Davis is expected to sign the budget Thursday and begin focusing his energy on saving his job.

The monthlong deadlock was caused by disagreement between Democrats and Republicans over tax increases and spending cuts.

Democrats, who hold big majorities in both houses but need Republican help to muster budget-approving two-thirds votes, wanted a half-cent sales tax to help close the budget gap. Republicans said the gap could be closed using existing revenues and deep cuts.

The Senate approved the compromise Sunday night and sent it to the Assembly, which took up the matter at noon Monday.

Negotiations continued through the night and Wesson said he would hold members on the floor as long as necessary, breaking a 26-hour continuous session record set in 1963 during an education dispute.

"Yesterday I decided it was important for us to work around the clock to get this job done," Wesson said, reminding his colleagues that he used to coach football. "Sometimes in the fourth quarter, people get tired. Sometimes when people get tired they need to press forward and that's what we've done."