The High Court unanimously ruled that the ACT's law could not operate concurrently with the federal Marriage Act, which was amended in 2004 to define marriage as between a man and a woman.
"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 solemnised in Australia only between a man and a woman," the court said in a statement issued alongside its ruling. "That Act is a comprehensive and exhaustive statement of the law of marriage."
Rodney Croome, national director of the advocacy group Australian Marriage Equality, said his group knows of about 30 same-sex couples who have married since Saturday, though the actual number may be slightly higher. The ruling means their marriages are now nullified.
Outside the court in Canberra, a tearful Croome, flanked by several same-sex couples who were married in the past week, said the ruling was a defeat for marriage equality but there had been a greater victory this week.
"And that victory was the nation saw for the first time, I believe, what is really at the core of this issue they've seen that marriage equality is not about protest or politics or even about laws in the constitution, ultimately. Marriage equality is about love, commitment, family and fairness," Croome said.
Lyle Shelton, managing director of Australian Christian Lobby, which opposes same-sex marriage, praised the court ruling and said common sense had prevailed.
As for the ruling's impact on the newly-wedded couples, Shelton said it was "really sad that they were put in a position" in which they were allowed to marry before the court handed down its judgment.
"But I guess they knew as they went into these arrangements that the decision may not go their way," he said.
Prime Minister Tony Abbott opposes gay marriage and his coalition blocked two federal bills last year that would have allowed legal recognition of same-sex partnerships.
The ruling comes a day after India's Supreme Court struck down a 2009 lower court decision to decriminalize homosexuality, dealing a blow to gay activists who have fought for years for the chance to live openly in India's deeply conservative society.
Gay marriage has legal recognition in 18 countries as well as 16 US states plus the District of Columbia.
-AP