NEW YORK — President Obama’s views on gay marriage are apparently still evolving.

At a fundraiser Thursday sponsored by gay Democrats here, the president listed his record of accomplishments on extending rights for gay Americans and declared: “I believe that gay couples deserve the same legal rights as every other couple in this country.”

But as many in a crowd of more than 600 shouted “marriage,” and “do you support it,” Obama declined to directly address the issue, even as New York’s legislature continued working Thursday night on a bill that would make the state the sixth to legalize gay marriage.

“Now I understand there’s a little debate going on in New York,” Obama said. But he added, not directly addressing the issue, “New York is doing exactly what democracy is supposed to do.”

Obama emphasized marriage was a state issue, not a federal one, and that states would come to their own decisions.

The appearance was part of three fundraisers the president squeezed into a short evening trip to Manhattan. More than 600 people from at least 22 states came for the LBGT event, according to organizers, donating from $1,250 to $35,800 (the legal maximum) to Obama’s campaign and the Democratic National Committee to attend.

The timing was purely accidental; the fundraiser was long-scheduled, and the New York legislature was expected to vote on the gay marriage bill earlier this month.