Gay-rights and traditional-values groups reacted swiftly Wednesday to President Obama’s open support for gay marriage, which came hours after North Carolina citizens voted in a landslide to block such nuptials.

Joe Solmonese, the outgoing president of the Human Rights Campaign, the nation’s largest gay rights organization, praised Mr. Obama for leading America out of “its shameful history of discrimination and injustice.”

Added the group’s incoming president, Chad Griffin: “For the millions of young gay and lesbian Americans across this nation, President Obama’s words provide genuine hope that they will be the first generation to grow up with the freedom to fully pursue the American dream.”

Mr. Obama’s announcement “marks a historic turning point for our freedom to marry movement,” said Evan Wolfson, founder and president of Freedom to Marry.

It’s “a proud day for all Americans,” said former George W. Bush administration solicitor general Theodore B. Olson, who’s pushing a federal court case against California’s gay marriage ban.

Celebrities also hailed the news.

“BREAKING: Obama I voted for finally takes office. #BetterLateThanNever,” tweeted Danny Zuker, a writer and executive producer of the TV show “Modern Family,” which features a two-dad family. Jane Lynch, Suze Orman, Sandra Bernhard, Chad Lowe and Meghan McCain also took to Twitter to express their joy.

Lesbian, gay, bisexual and transgender (LGBT) Americans “are right to be angry that this calculated announcement comes too late to be of any use to the people of North Carolina, or any of the other states that have addressed this issue on his watch,” he said.

Traditional-values groups — who took heart in Tuesday’s 61 percent vote in favor of a North Carolina marriage amendment [-] said Mr. Obama’s comments guarantee an escalation of the gay marriage issue.

The president has finally “come out of the closet” on his support for gay marriage, said Andrea Lafferty, president of the Traditional Values Coalition. Mr. Obama needs new support, and “who better to appease than the LGBT community with tons of disposable income to fund his re-election campaign?”

“President Obama has become the ultimate flip-flopper,” said Kris Mineau, president of Massachusetts Family Institute, saying that he supported a redefinition of marriage in 1996 as a state Senate candidate and opposed same-sex marriage in his 2004 Senate and 2008 presidential races, only to switch again Wednesday.

Tony Perkins, president of Family Research Council, also saw broad political ramifications. “Considering that 10 of the 16 battleground states have marriage amendments that could be overturned by the president’s new policy position on marriage, today’s announcement almost ensures that marriage will again be a major issue in the presidential election,” he said.

“Politically, we welcome this,” said Maggie Gallagher, co-founder of the National Organization for Marriage and director of the Culture War Victory Fund. “We now have a clear choice between Romney and Obama, and we look forward to demonstrating in November that it’s a bad idea for a national candidate to support gay marriage.”

Cardinal Timothy M. Dolan, president of the U.S. Conference of Catholic Bishops, called the president’s comments “deeply saddening.”

Catholic bishops “stand ready to affirm every positive measure taken by the president and the administration to strengthen marriage and the family,” he said. “However, we cannot be silent in the face of words or actions that would undermine the institution of marriage, the very cornerstone of our society. The people of this country, especially our children, deserve better.”