A Philadelphia judge has ruled that a gay couple banned from contacting each other while on probation have the same rights as a married couple.

Daniel Mangini and Stephen Roberts, who have been together for 20 years, owned property, shared bank accounts and helped raise Roberts’ young niece.

They later became addicted to methamphetamine, and in 2004 were convicted of dealing 100 grams of the drug.

After they were released from prison, the US Probation Office refused to let them live together, as policy forbids felons on probation from associating with each other unless they are blood relatives or spouses.

This meant they would not be able to speak to, meet or email each other during their five-year probation period.

“The defendants were in every way a family,” Judge Marvin Katz wrote in a ten-page opinion, according to The Philadephia Inquirer.

The judge also cited a landmark Supreme Court ruling and its decision that same-sex couples have the same right to form intimate relationships as opposite-sex couples.

“I’m elated,” said Mangini, who added that he and Roberts had recovered from their addiction.

“This opens possibilities. Finally we get to resume our lives together and dream for the future,” he told the Inquirer.

“This is truly a great day for our clients, who have been barred from having any contact with each other for more than a year,” said Mary Catherine Roper, a staff attorney with the ACLU of Pennsylvania.

“By honouring their commitment to each other and fighting to be together, Dan and Steven have helped to bring about ground-breaking law requiring equal treatment for same-sex couples.”