Australia's highest court on Thursday struck down the nation's first gay marriage law, invalidating the marriages of more than two dozen gay and lesbian couples.

Australian Capital Territory (ACT) lawmakers approved the marriage law in October and it went into effect on Saturday.

Upon the law's passage, Prime Minister Tony Abbott, whose conservative Liberal-National coalition swept into power on September 7 on a pledge to lower taxes, filed a legal challenge to the law, arguing that only the federal government has the power to regulate marriage.

The High Court unanimously agreed that the ACT's law ran afoul of the federal Marriage Act, which was amended in 2004 to define marriage as a heterosexual union.

“The Marriage Act does not now provide for the formation or recognition of marriage between same sex couples. The Marriage Act provides that a marriage can be solemnized in Australia only between a man and a woman,” the court said in a statement.

Sydney University constitutional lawyer Anne Twomey told the AP that the ruling means that only the federal government has the power to legalize marriage for gay couples.

Ivan Hinton, whose marriage to Chris Teoh will now be annulled, said that he was heartbroken but added, “I wouldn't have missed it for the world.”