Australia’s prime minister has rushed gay marriage into law by gaining a final signature on a bill hours after it was overwhelming endorsed by the country’s parliament.

As the nation started planning weddings that can take place in a month, Prime Minister Malcolm Turnbull travelled to Government House where Governor General Sir Peter Cosgrove signed the bill into law on behalf of the Queen, Australia’s constitutional head of state.

Sir Peter’s signature makes gay marriage legal in Australia from Saturday, when same-sex couples who wed overseas will be recognised as married under Australian law.

Couples who intend to marry must give a calendar-month notice, making gay weddings legal on January 9, Mr Turnbull said.

Mr Turnbull 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 centre of Sydney’s gay nightlife which is in Mr Turnbull’s electorate.

Mr 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.

Countries where same-sex marriage is legal(PA Graphic)

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 centres and parks at no charge over a 100-day period from January 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.

Neville Wills, 98, plans to marry his partner of 39 years, Ian Fenwicke, 74, next month.

Some practical reasons to marry become pressing with age. Relatives have contested wills that left estates to same-sex partners, and gays and lesbians want rights to access and medical consultation when a partner is hospitalised.

“The reason is to have a legal relationship that’s not in any way challenged — and, of course, we love each other,” Mr Wills said. “We’ll get the legal relationship straightened out in January. Call it a wedding if you like, I’m not romantic,” he added.

Gay marriage was endorsed by 62% 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 Australian Capital Territory (ACT) 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 (£30) cost of a wedding certificate for any of the 31 same-sex couples whose short-lived marriages were ruled invalid and want to marry again.