* Keeping social conservatives in mind ahead of 2012
* Some liberals frustrated by position on issue (Adds comments from gay pride event)
By Patricia Zengerle
WASHINGTON, June 29 (Reuters) - President Barack Obama on Wednesday praised New York's move to legalize same-sex marriage but stopped short of endorsing it himself, maintaining a stance that has frustrated many liberal supporters.
"What I've seen happen over the last several years, and what happened in New York last week, I think, was a good thing," he told a new conference.
New York became the most populous state to allow gay marriage on June 24, in a high-profile victory for gay rights activists ahead of the 2012 presidential and congressional elections.
But Obama held to his cautious line on an issue that could alienate social conservatives as he runs for re-election next year, saying the marriage issue is a matter that should be decided by the states, not the federal government.
"Each community is going to be different and each state's going to be different," Obama said.
Obama, who backs civil unions for same-sex couples, hinted late last year that he might eventually give his backing to gay marriage. He said then that his views were "evolving."
But at the news conference, he would not be drawn out on whether he personally supports same-sex marriage.
"I'm not going to make news on that today," he said.
Gay and lesbian voters supported Obama strongly as he ran for the White House in 2008 and he will need their support as he runs again this time, even as he seeks to shore up his support among more centrist independent voters, whose support is essential in a presidential race.
Obama has stressed that he has helped advance some gay issues, including winning repeal of the ban on gays serving openly in the military and his order for the U.S. Department of Justice to stop defending a law banning gay marriage.
"This administration, under my direction, has consistently said, 'We cannot discriminate as a country against people on the basis of sexual orientation,'" Obama said. "And we have done more in the two and half years that I been in here than the previous 43 presidents to uphold that principle."
Some liberals have attacked Obama because he has not taken a stronger stand on the marriage issue.
At a gay pride event Obama hosted at the White House later on Wednesday, he listed steps his administration had taken to fight discrimination, including repealing the military's "don't ask, don't tell" ban on service by openly gay people.
"I have delivered on what I promised. But that doesn't mean our work is done," Obama said. "There are going to be times when you're still frustrated with me ... What I also know is that I will continue to fight alongside you."
He got a mostly warm reception. "He says he's evolving. I believe him," said Dan Savage, an openly gay columnist and activist. He added, "I want him to hurry along."
The U.S. public is nearly evenly split over whether gays and lesbians should be able to marry legally, with 45 percent in favor and 46 percent opposed, according to a Pew research poll released last month.
(Additional reporting by Caren Bohan and Jeff Mason) (Editing by Cynthia Osterman and Paul Simao)
Our Standards: The Thomson Reuters Trust Principles.