With New York’s 29 electors, the interstate compact would have 160 electors, or the 60 percent of the 270 it needs to take effect.

The bill has been teetering between the chambers for years, and this is the first year it has passed both chambers. The bill now returns to the Senate, and requires the signature of Governor Andrew Cuomo, who has not taken a public position on the legislation.

The Senate, which had approved the bill in previous sessions, passed the measure swiftly, 57 to 4. The chamber did not take up the bill last year.

The Assembly debated the bill for hours, and the resulting vote of 100 to 32 scrambled the usual party divide.

Those supporting the bill argued that the Electoral College is no longer the best way to elect a president, and that abolishing that system will increase New York's importance in the process, increasing its share of candidate visits and campaign ads.

That argument didn’t persuade Assemblyman Kevin Cahill, a Democrat.

“I need something other than our personal need for attention and pork,” he said.

Assemblyman Jeffrey Dinowitz, a Democrat, sponsored the bill in the Assembly, along with Sen. Joe Griffo, a Republican, in the Senate.

“The United States of America elects people to various offices by popular votes except for one office. That office is the President of the United States,” Dinowitz said.

Several proponents pointed to the handful of times the runner-up in the popular vote won the Electoral College.

“One of the things [the founding fathers] got wrong was how we elect the president,” said Assemblyman Richard Gottfried, a Democrat.

Dissenters pointed to the long history of the Electoral College, and said if the president is to be elected by popular vote it should be done by changing the Constitution.

“A compact may be technically legal but [we’re] not sure if Congress should approve,” said Assembly Majority Leader and Democrat Joe Morelle. “I would not argue that we throw out states rights. We should not let other people choose New York electors. We should let New Yorkers choose New York electors.”