Zachariah Long (left) and Edward Ritchie protest against a gay-marriage bill in Annapolis, Md., on Feb. 17. The bill passed, but the issue is being put directly to Maryland voters on Nov. 6.

Patrick SemanskyAP

Six states and the nation's capital have recognized the legality of same-sex marriages, either by law or by court order.

But over the past decade and a half, each of the 30 states to consider constitutional amendments that would outlaw such unions has adopted the ban — from Alaska in 1998 to North Carolina earlier this year.

That may change on Election Day, when voters in Maryland, Washington, Maine and Minnesota — awash in money, messages and advertisements from both sides of the issue — will make their decision on whether to recognize gay marriage.

It will be the first major test since President Obama in May became the first president to publicly state his support for gay marriage.

This week, Obama also personally endorsed ballot measures in Maine, Maryland and Washington state that would legalize gay marriage; he has previously expressed opposition to efforts in Minnesota to pass a constitutional amendment barring same-sex marriage.

Advocates of same-sex marriage say they believe that the president's endorsement and backing from the NAACP has helped boost support among African-Americans, who have long opposed gay marriage in larger percentages than whites or Hispanics. Blacks may prove a key in deciding the ballot issues — particularly in Maryland, where nearly 30 percent of the state's voting population is black. The national average is about 13 percent.

"We believe, with the president completing his journey and the NAACP following suit, there has been over the past year a pretty significant increase in support from African-American voters," says Marc Solomon, national campaign director for Freedom to Marry. "Obviously, having the president's support is important."

A national Pew Research Center poll taken in July, however, two months after the president announced his support for gay marriage, found that 51 percent of blacks surveyed said they opposed gay marriage, essentially unchanged from a Pew survey the month before Obama's announcement.

While those numbers suggested that support among blacks had not increased since Obama's announcement, opposition among the group was down from 63 percent in 2008 and 67 percent in 2004.

Deana Bass of Maryland Marriage Alliance, which opposes legalization, said voters can support the president but still believe he's wrong on the marriage issue.

"People will definitely vote for who they want to vote for," she said. "But I think people certainly understand that it's possible to be tolerant of the rights of others without redefining marriage."

The Maryland Marriage Alliance has featured black preachers in its ads, and a note opposing gay marriage written by a niece of the Rev. Martin Luther King Jr. appears on the organization's website.

Polls suggest that the contests will be extremely close, with Maine, whose voters in 2009 rejected legalizing gay marriage, currently seen as the state most likely to pass one authorizing the state to issue marriage licenses to same-sex couples.

The other contests, in Maryland and Washington, where voters will decide whether to uphold existing state laws legalizing same-sex marriage, and in Minnesota, are considered too close to call.

The Election Day votes come as the issue of gay marriage, in the wake of a significant appeals courts decision, appears certain to land at the U.S. Supreme Court.

A series of lower courts have found the federal ban on gay marriages unconstitutional. And an Oct. 18 decision by the 2nd U.S. Circuit Court of Appeals, the latest to rule that the federal Defense of Marriage Act violates the U.S. Constitution, said the act discriminates against gay Americans in a way that requires "heightened scrutiny" because of its potential grounding in bias against one group of people.

The Catholic Church, including the fraternal group Knights of Columbus, has been a major funder of the anti-gay-marriage efforts, particularly in Minnesota and Washington state. A national poll taken earlier this year showed that nearly 59 percent of Catholics support gay marriage, but that church members living in the Midwest are about evenly divided over the issue.

Supporters of same-sex marriage include New York Mayor Michael Bloomberg, who has committed $750,000 to efforts in the four states.

Whatever happens Nov. 6, or in the courts, advocates will continue their effort to legalize gay marriage state by state, says Freedom to Marry's Solomon.

"We know that the Supreme Court never likes to get too far out in front of where Americans are, so we'll just try to keep racking up wins," he said, adding that his group would advocate for pro-gay-marriage legislation in Delaware, Rhode Island and Hawaii.

"Those are all real possibilities in 2013," said Solomon. All three states already recognize same-sex civil unions.