In a dramatic shift, Maryland voters overwhelmingly would vote to uphold a law allowing same-sex marriage, according to a survey released Thursday by Public Policy Polling.

Fifty-seven percent of likely voters would vote to uphold the law allowing same-sex marriage, while 37 percent would not, representing a 12-point shift from an identical survey in early March. Fifty-two percent think gay marriage should be recognized, while 39 percent do not. Both polls were commissioned for Marylanders for Marriage Equality.

Maryland passed a gay marriage law, but it doesn't take effect until January 1, 2013. Opponents of the law are seeking to get 55,736 signatures to force a referendum on it by June 30, which is likely to happen. Maine and Minnesota will vote on gay marriage in November.

The poll notes that the shift can be explained "almost entirely" by a change in black voters' attitudes. Previously, 56 percent said they would vote against the new law, with 39 percent saying they would vote for uphold it. Now, 55 percent say they will vote for the law and 36 percent are opposed.

President Barack Obama came out for gay marriage between the polls, amid rising support for same-sex unions.

A Washington Post/ABC poll also showed that black public opinion shifted after Obama's announcement, with 59 percent of blacks saying they backed same-sex marriage, an 18-point shift compared to polls leading up to the survey. PPP also released a poll showing an 11-point jump in North Carolina favor for gay marriage among black voters following the passage of Amendment One, which banned gay marriage, domestic partnerships and civil unions.

However, there is a note of caution -- pro-gay marriage votes have fared poorly at the ballot box, with 31 states passing same-sex marriage bans since 1998, as recently as North Carolina earlier in May. (Arizona rejected a more expansive ban of gay marriage and domestic partnerships in 2006, but passed a narrower version in 2008.)

Here are some reactions to Obama's gay marriage announcement:

PHOTO GALLERY Politicians React To Obama On Same-Sex Marriage