Image caption The first same-sex marriages could go ahead by Christmas

The Australian Capital Territory has become the first part of Australia to legalise same-sex marriage.

The ACT parliament passed a bill that will allow gay couples to marry, after a short debate on Tuesday.

Celebrants will now be allowed to marry same-sex couples inside the ACT, regardless of which state they live in.

Federal law, however, specified in 2004 that marriage was between a man and a woman, and the federal government is expected to challenge the move.

The move was passed in the 17-member ACT Legislative Assembly, backed by Labor and the Greens, with the Liberals voting against.

"There is no longer any excuse, if there ever was, to discriminate against same-sex couples in our community," ACT Chief Minister Katy Gallagher told the parliament.

"They are our children, our parents, our brothers, our sisters, our leaders, our business people, our mentors and our colleagues."

"More than anything, they are our equals. The Marriage Equality Act puts this fundamental principle and human right into law," the Australian Broadcasting Corporation quoted her as saying.

Ms Gallagher said that the first weddings could take place by the end of the year.

'Invalid'

Attorney-General George Brandis, however, says the local law will face a legal challenge, because it is inconsistent with the national-level Marriage Act.

"It would be very distressing to individuals who may enter into a ceremony of marriage under the new ACT law, and to their families, to find that their marriages were invalid," a statement from the Attorney-General's Office said.

The ACT bill was amended shortly before it passed in an attempt to strengthen it against a potential challenge.

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

His sister, however, has recently disclosed that she is engaged to her female partner.

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