ALBANY, N.Y. - The lights went out, the live television feed went black, and pandemonium erupted on the floor as the coup unfolded.

The Republicans seized control of the New York Senate this week in a takeover that played out like a comic opera: The Democrats locked the chamber's brass gates and hid the keys, and the GOP rebels vowed to convene in a park outside the state Capitol if necessary.

With just days left in the legislative session, the rebellion may thwart Democrats' attempts to legalize gay marriage and expand tenants' rights.

But more than that, the hard feelings could paralyze the Capitol while the state is dealing with a fiscal crisis, damage Democratic Gov. David Paterson, and reinforce New York's reputation for legislative gridlock.

Paterson called the drama "despicable."

The New York Post ran a mocking front-page photo of a clown and the headline "Let's get serious."

Complaining of the Democrats' attempts to raise taxes and increase spending, the 30 Republicans in the Senate pulled off the coup by making common cause with two of the least savory Democrats in the 62-member chamber. After the overthrow, one of the turncoats was installed as Senate president.

The ousted Democrats - who had been in power for only six months, after 40 years in the minority - swore the maneuver was illegal. Yesterday they said they would seek a temporary restraining order to stop the Republicans from taking power, and would boycott the chamber in the meantime.

The Democrats are "fully prepared to go back to the people's work but will not enter the chamber to be governed by unlawful rules," said Austin Shafran, a spokesman for the ousted leadership.

The legislative session is scheduled to end June 22, but the new leadership said it would work all summer if necessary. The Democrat-led Assembly has stayed out of the fight.

The plot was orchestrated by billionaire B. Thomas Golisano, owner of hockey's Buffalo Sabres.

Golisano helped bankroll the Democrats' Senate victory in the fall but grew angry earlier this spring over Majority Leader Malcolm Smith's support of a budget that would increase spending and raise taxes on the wealthy.

In April, Golisano met with Smith to talk things over. According to Golisano, Smith fiddled with his BlackBerry and didn't seem to be paying attention. Golisano soon began meeting secretly with Republicans to plot Smith's overthrow.

To pull off the coup, the Republicans needed two Democrats. They found them in two lawmakers emblematic of Albany's problems:

Sen. Pedro Espada Jr. of the Bronx, the newly installed Senate president, who owes tens of thousands of dollars in fines for election-law violations and is under investigation over health-care clinics he operates.

Sen. Hiram Monserrate of Queens, who has been charged with slashing his girlfriend's face with a broken glass and could lose his seat if convicted.

With the plan in place, GOP Sen. Thomas Libous introduced without fanfare a nondescript bill that, once read, toppled the Democratic leadership. A news release went out urging reporters to go to the chamber immediately because a historic change was going on "RIGHT NOW."

Shocked Democrats stalled, then walked out, turning off the lights. They shut down the in-house television feed. "Please Stand By" was broadcast instead.

Smith's Democrats called it a power grab that had nothing to do with reform. They called Espada a disgrace and Monserrate a thug.

"Don't talk to me about ethical background in Albany," Golisano shot back. "We have a governor who stood on a podium on national television and said he had extramarital affairs and used cocaine."