ALBANY, N.Y. - Republicans and two dissident Democrats appeared to take control of New York's Senate yesterday after the two New York City renegades voted with the GOP to throw the fledgling Democratic majority out of power in a parliamentary coup.

The coup throws into doubt the movement to legalize same-sex marriage.

The decision by Sens. Pedro Espada Jr. of the Bronx and Hiram Monserrate of Queens to join the coalition gave Republicans a 32-30 voting edge on hastily introduced measures that changed the leadership structure. Neither Espada nor Monserrate changed party affiliation.

Democrats held the Senate barely five months after being out of power for four decades.

Within an hour of the overthrow, Republicans named Espada temporary president of the Senate and Republican Dean Skelos of Nassau County vice president and majority leader. Skelos was the majority leader in 2008.

Those are the most powerful positions in the chamber. With them, the bipartisan coalition can direct legislation and reassign committee and leadership posts.

Democrats are expected to challenge yesterday's action in court.

Same-sex marriage is one of the major policy issues still in the balance for the last two weeks of the regular legislative session. Although passed in the Democrat-led Assembly, it is stalled in the Senate.

"If it doesn't wipe it out, it puts a great mountain in front of it," said the Rev. Duane Motley, founder of New Yorkers for Constitutional Freedoms, which has opposed same-sex marriage.

Another major issue has a hard deadline. A law giving the New York City mayor greater control of city schools is scheduled to expire at the end of the month, unless the full Legislature acts.

Senate Democrats have sought to take away some of Mayor Michael Bloomberg's authority, while maintaining overall mayoral control. But for years, he and the Senate's Republican conference have been close on policy, and the billionaire mayor has funded many of their campaigns.

Democrats seemed confused and delayed a vote on the motion to change leadership for more than 10 minutes as they telephoned for advice. Then they voted to adjourn and quickly left the chamber. The Democratic conference contended that nothing had changed.

"This was an illegal and unlawful attempt to gain control of the Senate and reverse the will of the people who voted for a Democratic majority," stated Austin Shafran, spokesman for Sen. Malcolm Smith of Queens, who was elected Democratic majority leader in January but struggled to hold together a fractious conference.

New York's government is run by the near absolute control of the majority party and its top leaders. Yesterday's action, if it holds, would create the first coalition in power for at least 50 years.