Media playback is unsupported on your device Media caption Ivan Hinton: "This is personally devastating"

Australia's High Court has overturned legislation allowing gay marriage in the Australian Capital Territory (ACT).

The ACT parliament passed a bill in October making the territory the first part of Australia to legalise same-sex weddings.

But the national government challenged the decision, saying it was inconsistent with federal laws.

Some 27 couples who married since the law came into effect last weekend will now have their unions declared invalid.

The court said the issue should be decided by parliament - which in September 2012 voted down gay marriage legislation.

'Matter for lawmakers'

The ACT legislation had allowed gay couples to marry inside the ACT, which includes the Australian capital, Canberra - regardless of which state they live in.

Federal law, however, specified in 2004 that marriage was between a man and a woman.

Civil unions are allowed in some states in Australia.

Image caption Same-sex marriage is backed by many Australians, particularly younger generations

Image caption Several couples, including Chris Teoh (left) and Ivan Hinton, got married after the ACT legalised gay marriage in October

Image caption The House of Representatives has previously voted against a gay marriage bill

The High Court in Canberra ruled unanimously against the ACT legislation on Thursday, saying that it could not stand alongside national-level laws.

"Whether same sex marriage should be provided for by law is a matter for the federal parliament," it said in a statement.

"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," it added.

Attorney-General George Brandis had previously warned that the local law would face a legal challenge, because it was inconsistent with the country's Marriage Act.

'Clarion call'

Australian Marriage Equality National Director Rodney Croome said in a statement: "This is devastating for those couples who married this week and for their families."

Ivan Hinton, who had married his partner Chris Teoh on Saturday, tearfully told reporters: "In less than a week we've been married and we've been unmarried, at least on a legal level."

Media playback is unsupported on your device Media caption Judy Brown: "Activists are already working on federal legislation"

"We're still married," he added. "I've made commitments to Chris to spend the rest of my life with him."

Greens leader Christine Milne said: "What the court has decided has made it very clear that the Federal Parliament has the power to legislate for marriage equality."

The ruling was "a clarion call for everyone in the country who supports marriage equality to now put pressure on the Federal Government and the Federal Parliament to change it", she added.

However, Liberal Party politician Eric Abetz said on Twitter: "The High Court's overruling of ACT same sex marriage laws is welcome."

In a statement, the Australian Christian Lobby, which opposes gay marriage, said: "Marriage between a man and a woman is good for society and beneficial for governments to uphold in legislation."

"It is about providing a future for the next generation where they can be raised by their biological parents, wherever possible," the statement said, adding that "it is now time to move on".

Prime Minister Tony Abbott, who leads a Liberal-National coalition, opposes same-sex marriage.

Last year, a bill allowing same-sex marriage was voted down in both houses of Australia's national parliament.

In April, New Zealand became the first country in the Asia-Pacific region to legalise gay marriage.

Gay marriage is also legal in countries including Canada, France, Argentina, Uruguay and South Africa, and some US states.