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

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

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

In all three states, the outcome is expected to be close, though polls so far give an edge to gay-marriage supporters.

If any of the measures are approved, it would be the first time 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.