The federal government introduced amendments Friday to close a legal loophole that could have undermined scores of gay marriages around the world.

Changes to the Civil Marriage Act were prompted by an Ontario divorce case involving a gay couple who live in different countries.

The federal government had filed documents in the case stating even though the couple was married in Canada, they couldn't be considered legally married because it wasn't recognized in their U.S. and U.K. home countries.

The governing Tories faced a backlash when gay activists and opposition parties accused them of trying to rewrite same-sex marriage laws.

But the government quickly backtracked and said the marriages were valid, and it didn't want to reopen the definition of marriage debate, but the legislation still needed a tweak to close the loophole.

Toronto-based family law lawyer Grant Gold said the problem wasn't noticed at first because same-sex marriage was relatively new and it hadn't been tested in a divorce case.

"I certainly wasn't aware of it as a problem until this last case came forward with the absurdity of the position the government took in my view, which is if the marriage wasn't recognized as legal in a home jurisdiction, it wasn't recognized as legal in Canada, even though Canada allowed the marriage," he told CTV News Channel Friday.

Gold said the proposed changes are good for same-sex couples who want to end their marriage, but live in another country.

"It means they can come to Canada, they can get divorced, and then they're free to marry again if that's what they choose to do," Gold said.

Minister of Justice Rob Nicholson said in a release Friday the government will fix the "anomaly" in the law.

The changes won't address child or spousal support issues. Arrangements for property, custody and access are to be determined in a couple's jurisdiction, the release stated.

Follow John Size on Twitter