CANBERRA, Australia  — Australia's prime minister rushed gay marriage into law on Friday by gaining a final signature on a bill hours after it was overwhelming endorsed by Parliament and as the nation started planning weddings that can take place in a month.

Prime Minister Malcolm Turnbull traveled to Government House where Governor-General Peter Cosgrove signed the bill into law on behalf of Queen Elizabeth II, Australia's constitutional head of state.

Cosgrove's signature makes gay marriage legal in Australia from Saturday, when same-sex couples who wed overseas will be recognized as married under Australian law. Couples who intend to marry must give a calendar-month notice, making gay weddings legal on Jan. 9, Turnbull said.

He described Parliament voting late Thursday for gay marriage, with only four lawmakers registering their opposition, as a historic moment.

"Containing my emotions to a suitable, prime ministerial level of calm is quite challenging. I am absolutely pumped. I think this is so wonderful," he said after Parliament passed the bill and the public gallery erupted with a standing ovation.

Celebrations continued late into the night in Oxford Street, the center of Sydney's gay nightlife which is in Turnbull's electorate.

Turnbull has been a long-term advocate for marriage equality and is the first prime minister to attend Sydney's renowned annual Gay and Lesbian Mardi Gras, which is also in his electorate.

Hours after Parliament's action, a Sydney municipal council offered free venues to host same-sex marriages.

The Inner West Council is accepting bookings for same-sex marriages in its halls, community centers and parks at no charge over a 100-day period from Jan. 7.

"This is an historic day in the struggle for civil rights in Australia," Mayor Darcy Byrne said.

It follows the downtown Sydney municipality's decision in October to offer free venues for same-sex weddings should they become lawful.

The Australian Capital Territory government, which administers Canberra, the national capital, introduced its own same-sex marriage law in 2013 that was overturned by the High Court within a week.

ACT Attorney General Gordon Ramsay said his government would waive the 55 Australian dollar ($41) cost of wedding certificate for any of the 31 same-sex couples whose short-lived marriages were ruled invalid and want to marry again.

"It's a way of being able to acknowledge the difficulties that some of those couples have been through," Ramsay told Australian Broadcasting Corp.

Anne-Marie Delahunt, who married her partner Meg Clark in Canberra in 2013, said she would take up the government's offer when they marry again in February.

"I think it was a touching measure from the ACT Government to say that our second marriage certificate will be free," Delahunt told ABC.

Gay marriage was endorsed by 62 percent of voters who responded to a national postal ballot by November.

Most gay rights advocates believed the government should have allowed marriages years ago and saw various ideas for a public survey as a delaying tactic. The U.N. Human Rights Committee had called the ballot survey "an unnecessary and divisive public opinion poll."