The law was passed with the support of legislators from the government Labor and Green parties on a vote of 9-8. The ACT Legislative Assembly has only 17 seats.
In announcing the new law, ACT openly gay Deputy Chief Minister Andrew Barr told the assembly, quoted by The Sydney Morning Herald, "We are making a clear statement about the sort of society that we want to live in ... Whether it's the rainbow territory or the city of love, it's an important journey for us."
It is the first Australian state to approve a gay marriage bill and the first same-sex wedding in the country is expected to be held in Canberra in December. However, federal Attorney-General George Brandis said that based on legal advice, the legislation is not valid.
He suggested that ACT wait until the High Court rules on the constitutional validity of the law, but ACT Chief Minister Katy Gallagher turned down the request.
The basis of Mr Brandis claim is that the Australian federal law was amended in 2004 that specified marriage can only be between a man and a woman. However, the law specified that it applies to heterosexual couples only, prompting some lawyers to argue that states are free to pass same-sex marriage laws as what ACT just did.
The gay lobby group Australian Marriage Equality said thousands of Aussie same-sex couples want to walk the aisle in Canberra, but not Christine Forster, the lesbian sister of Prime Minister Tony Abbott who preferred to be married in Sydney to her girlfriend to whom she has been engaged in March 2013.
Mr Abbott is personally against same-sex marriage but has promised to attend his sister's wedding if that day would happen.