Same-sex married couples who were living in states that did not recognize their unions and who previously filed claims for Social Security benefits will be able to collect those payments, the government said on Thursday.

The Justice Department told lawyers for two plaintiffs seeking benefits that the Social Security Administration would apply the Supreme Court’s June ruling declaring that marriage is a constitutional right, Obergefell v. Hodges, retroactively. It would apply to individuals with pending claims who were married before the decision and living in states that did not recognize same-sex marriages.

Details were not yet available, and it is not clear when the Social Security Administration will enact the new policy. But the rules are expected to be applied to previously filed claims that are pending in the administrative process or litigation, according to Lambda Legal, a gay rights advocacy group that represented the plaintiffs. The Social Security Administration was not available for comment.

“With this good news, we are hopeful that widows, widowers and retirees, wherever they lived, who need Social Security spousal benefits earned through years of hard work, will soon be able to receive them,” said Susan Sommer, director of constitutional litigation for Lambda Legal.