ALBANY - With protesters angry about budget cuts rallying inside the Capitol, state lawmakers completed work on a $132.5 billion state budget early Thursday morning.

The Senate passed the budget at about midnight and the Assembly followed at 1 a.m., as the state worked to finish the spending plan before the April 1 deadline.

In a press release issued just after the Assembly gaveled out, Gov. Andrew Cuomo called it "a historic and transformational budget for the people of the state of New York."

The vote occurred amid a marathon day of rallying as activists from across the state declared they would remain in the Capitol until Thursday morning to protest cuts contained in the state budget.

Cuts in Cuomo's budget -- namely to primary education spending, the State University of New York budget and job creation programs -- drew ire from several hundred protesters who arrived Wednesday afternoon, including a large contingent that planned to remain in the Capitol overnight.

From 2 p.m., when the protesters began arriving by bus, the Capitol reverberated with chants and cheers. Shouting "Hey hey, ho ho, these budget cuts have got to go!" and "The people united will never be defeated!," they made their way past security, demonstrated in the halls and on the Western Staircase, signs and fists in the air. But the public galleries of both Senate and Assembly chambers were never opened to the demonstrators.

A number of the groups involved, including the Alliance for Quality Education and Strong Economy for All, have ties to public workers or teachers unions who have sparred with Cuomo over the budget. All were incensed at the slated demise of the "millionaires tax," the income tax surcharge on high-income New Yorkers that expires at the end of the year.

They were young and old, from upstate and downstate, dressed in bandannas and hand-lettered T-shirts. Many were black and Hispanic.

Euline Williams, a 58-year-old assistant for the disabled in Manhattan, rallied on the Western Staircase with other members of the welfare-reform group Community Voices Heard.

"How are my children going to afford housing?" said Williams, a resident of a low-income apartment unit and a grandmother of 15. "What kind of education are they going to be able to offer their children?"

Another activist was Sarah Smithson, a 21-year-old political science major at the University of Albany, who wielded a sign that declared "Think of the Children."

The Jersey City native will graduate this spring with $60,000 in school loans. She said she felt compelled to protest on behalf of future students.

"The tuition will be increased, there won't be enough teachers, classrooms will be packed and crowded, and they won't be good environments to train the work force," she said.

Around her, protesters sang "Give Peace a Chance." They meditated. And in slumber-party fashion, they ordered pizzas. 70 of them, to be exact. Extra-large.

But the pies, from a local restaurant, Paesan's Pizza, were temporarily held up when police officials told protesters the delivery was a no-go.

Organizers turned to lawmakers for help. After some negotiating by Democratic Sens. Bill Perkins and Kevin Parker, a group of youth were allowed to ferry the pies through the freight entrance around 6:30 p.m.

"Just hang in there," Billy Easton, executive director of the Alliance for Quality Education, told the hungry, shouting crowd.

And for a brief moment, the pizza brought peace.

Perhaps because of the raucous nature of the protest, lawmakers stayed away from the chambers for much of the afternoon after passing a number of budget bills at midday. As the houses gaveled in after 9 p.m., they began passing the four final budget bills -- including those covering education and health care, the areas of greatest debate -- with accelerating "messages of necessity" from the governor. The Senate wrapped up its business just before midnight.

The district-by-district school aid "runs" weren't released until almost 9 p.m., and first suggested a discrepancy between the $1.2 billion cut promised in the budget agreement and the $900 million cut outlined in the school runs.

Sen. John Flanagan, R-Long Island, who chairs the Senate Education Committee, said lawmakers chose not to factor in $600 million in a one-time federal expenditure the state received in the 2010-2011 fiscal year when it measured next year's cut in state aid.

As for the almost $240 million in extra school aid that lawmakers restored to the executive budget, Flanagan said New York City got $53 million, plus roughly $85 million for special programs; Long Island got $43 million; and the rest of the state divided $57 million. (Approximately $30 million in other restorations went to associated education costs.)

Many of the protesters left on buses. The 300-400 who remained shuttled among the Assembly chamber, the Senate's western gallery and the governor's office, shouting "Hey Cuomo, you're the worst, time to put the people first." But the governor did not appear.

The protesters were told they could not remain in the Capitol overnight but were allowed to sleep in the Empire State Plaza concourse. Blankets and sleeping bags weren't allowed past the security gates. The state's open meetings law requires the legislative chambers to remain open to the public until an hour after the end of session.

Among those who planned to stay was Maria Pacheco, an eighth-grade Spanish teacher at Draper Middle School in Rotterdam.

Her school is cutting 44 teachers, as well as music, art and foreign language classes, she said. "It is about our students," she said. "Not the millionaires."

Reach Lee at 454-5057 or slee@timesunion.com. Casey Seiler and Rick Karlin contributed.