A Pennsylvania state appellate court on Monday recognized the common-law marriage of a same-sex couple, reversing a trial judge’s finding that at the time in question, it was “legally impossible” for two men to form such a union.

Michael Hunter, who filed the petition, lost his partner Stephen Carter in 2013, after Carter was killed in a motorcycle accident, the Legal Intelligencer reports. Carter died two months before the U.S. Supreme Court released the landmark opinion US v. Windsor, which struck down the federal Defense of Marriage Act.

Carter’s 2016 petition to recognize the marriage was unopposed, but John D. McBride, president judge of the Beaver County Court of Common Pleas, rejected it, on the basis that the state defined marriage as being between a man and a woman prior to 2014.

McBride also took issue with Hunter’s statement that he and Carter entered a common-law marriage before January 2005, the year the doctrine was abolished by the state legislature. Hunter did establish that he and Carter intended to marry when it was legal, the trial court found, but it was not proven that the couple had a common-law marriage. The state does recognize common-law marriages that were entered prior to 2005, PennLive reports.

Court in another state recognizes pre-Obergefell common-law marriage between gay partners