After decades of campaigning, it took just seconds to sign into law and the history books same-sex marriages in Ireland.

In a brief ceremony, staged for maximum publicity, Dublin's Justice Minister Frances Fitzgerald and Tanaiste (deputy prime minister) Joan Burton officially enacted the historic Marriage Act before a crowd of hundreds.

The legislation allows for same-sex weddings from Monday, and was made possible after Ireland became the first country in the world earlier this year to vote for same-sex marriage in a referendum.

Partners who were wedded abroad will automatically have their marriages recognised in Ireland from midnight on Sunday.

The stately George's Hall in Dublin Castle was set aside for the signing into law ceremony.

It was packed with veteran equality campaigners, gay and lesbian couples and well-wishers, as well as politicians keen to be pictured amid the scenes. They all erupted into applause and cheers after the formalities were completed.

Kieran Rose, chairman of the Gay and Lesbian Equality Network (Glen), said it was the final legal step in a remarkable journey for lesbian and gay people in Ireland.

"It is a truly joyful and historic moment, not just for lesbian and gay people, their families and friends, but for all Irish people," he said.

"It is the end of a long legal journey that began with decriminalisation in 1993, equality legislation in the 1990s, Civil Partnership in 2010 and culminated in the passing of the marriage equality referendum in May."

Ms Burton said a "rainbow movement" had turned Ireland into a "rainbow nation".