President Barack Obama on Thursday threw his support behind ballot measures in Maine, Maryland and Washington state that would legalize same-sex marriage.

Though the president first voiced his general approval for gay marriage in May, he had not previously offered specific endorsements of the three measures.

In each case, the endorsements were issued through the state branches of Obama's re-election campaign.

"While the president does not weigh in on every single ballot measure in every state, the president believes in treating everyone fairly and equally, with dignity and respect," said Paul Bell, the campaign's press secretary in Washington state.

"Washington's same-sex marriage law would treat all Washington couples equally, and that is why the president supports a vote to approve Referendum 74," Bell said.

In Maine, gay-rights supporters put the measure on this year's ballot in hopes of reversing the results of a 2009 referendum in which voters rejected a same-sex marriage law passed by the legislature.

In Maryland and Washington, gay-marriage laws were passed by lawmakers and signed by the governors earlier this year, but opponents collected enough signatures to hold referendums on whether the laws should be upheld or rejected.

Ed Murray, an openly gay state senator in Washington who has been fighting for years to legalize gay marriage, expressed gratitude to Obama.

"When I first began fighting in the legislature for marriage equality ... I would never have dared to dream that a president of the United States would one day step forward at this crucial moment, in the middle of his own close re-election campaign, to offer his support for our efforts," Murray said. "But that is exactly what President Obama has done, and it is an example of his courage and leadership."

Murray said his hope was to soon be able to wed his partner of 21 years, and he thanked Obama for "bringing that dream a little closer to reality."

Chip White of Preserve Marriage Washington, which opposes the gay-marriage law, said he was unsurprised by Obama's action.

"Until May of this year, the president's position was that marriage is the union of one man and one woman," White said. "No one called him a bigot or said he was unfair for holding that position. And Washingtonians who believe in the traditional definition of marriage as one man and one woman are not bigots."

If any of the measures are approved, it would be the first time that a state legalized same-sex marriage through a popular vote. Thus far, all 32 states voting on gay marriage have rebuffed it, while the six states that have legalized it did so through legislation or court orders.

In all three states voting on the issue on Nov. 6, the outcome is expected to be close, though the polls up to now have given an edge to gay-marriage supporters.

___

Associated Press writer Rachel La Corte in Olympia, Wash., contributed to this report.

Also on HuffPost:

Loading Slideshow...
  • Connecticut

    Since November 12, 2008

  • Delaware

    Gay marriage law <a href="http://www.huffingtonpost.com/2013/05/07/delaware-gay-marriage-law-_n_3232771.html" target="_blank">enacted</a>, weddings to begin July 1.

  • Iowa

    Since April 3, 2009

  • Maine

    In 2012, Maine voted in favor of a ballot amendment to legalize gay marriage.

  • Maryland

    The gay marriage bill was signed into law by Gov. Martin O'Malley (D) on March 1, 2012. Opponents later gathered enough signatures to force the issue back onto the ballot in November 2012, but voters rejected the effort against gay marriage.

  • Massachusetts

    Since May 17, 2004

  • Minnesota

    Same-sex marriage bill signed into law in May. Gay marriages will begin in August.

  • New Hampshire

    Since January 1, 2010

  • New York

    Since July 24, 2011

  • Rhode Island

    Bill passed in May. Law takes effect on August 1, 2013.

  • Vermont

    Since September 1, 2009

  • Washington

    On February 13, 2012, Gov. Christine Gregoire (D) signed a law allowing same-sex marriage ceremonies to begin on June 7, 2012. The process was delayed by gay marriage opponents who gathered enough signatures to put the issue up to a state vote in November 2012. They voted to approve it on Election Day.

  • Washington D.C.

    Since March 9, 2010

  • California

    The state initially began conducting gay marriages on June 16, 2008. On November 5, 2008, however, California voters passed Proposition 8, which amended the state's constitution to declare marriage as only between a man and a woman. In 2013, the Supreme Court ruled against that law, and the state shortly thereafter began sanctioning same-sex nuptials.