Finally, late Friday night, an agreement was reached.
Schwarzenegger posted a picture on Twitter, as the so-called big five of Sacramento shook hands on the budget deal in a five-hour meeting.
Democrats said the agreement will be made public in a hearing next week with a vote scheduled for Thursday.
The record-long stalemate prompted the governor to call for a second round of three-days-a-month furloughs which resulted in about a 14-percent pay cut to tens of thousands of state workers.
If a budget agreement had not been made by next week, the state wouldn't have been able to pay its bills and would have had to start issuing IOUs to state contractors.
This put pressure on the legislature to come to an agreement.
"Everybody had to make very difficult decisions. Everybody had to come up with solutions and agree upon solutions that they would not have otherwise, but I think we got through it the best we could," said Aaron McLear, the governor's spokesman.
Though there are no details yet on how lawmakers and the governor are planning to close the budget gap, a republican leader said the agreement does not call for any new taxes.
Also, the governor previously said he would not sign a budget without pension reform, which was a major sticking point in the negotiations.
It's also not clear how the budget will reflect on Schwarznegger, who leaves office next year at the end of his term.
Do you want the Eyewitness News team to call you? Get a FREE Morning Wake-up Call and personalized weather report at abc7.com/wakeup