BOSTON (AP) — Massachusetts will recognize same-sex marriages that were performed in Utah but later put on hold by the U.S. Supreme Court, the state attorney general's office said Thursday.

"Our view is that the marriages in Utah were validly performed and should be recognized here," said Chris Loh, a spokesman for Attorney General Martha Coakley.

Massachusetts was the first state in the nation to legalize gay marriage.

A federal judge overturned Utah's ban on same-sex marriage last month, and hundreds of couples got married. But within weeks the U.S. Supreme Court halted the weddings in one of the most conservative U.S. states until the courts sort out the matter. Utah then declared it would not recognize the weddings, but would allow couples to continue to receive whatever benefits they had obtained before the high court ruling.

U.S. Attorney General Eric Holder said last week that the federal government would honor gay marriage in Utah, meaning that couples who were married in the last month could file federal taxes jointly and get Social Security benefits for spouses, among other benefits.

Delaware Attorney General Beau Biden has said his state will recognize marriages performed during the interim period in Utah, and several other states have indicated they will do the same, according to a spokesman for the advocacy group MassEquality.