DUBLIN -- Ireland's citizens have voted in a landslide to legalize gay marriage, electoral officials announced Saturday -- a stunningly lopsided result that illustrates what Catholic leaders and rights activists alike called a "social revolution."

Friday's referendum saw 62.1 per cent of Irish voters say "yes" to changing the nation's constitution to define marriage as a union between two people regardless of their sex. Outside Dublin Castle, watching the results announcement in its cobblestoned courtyard, thousands of gay rights activists cheered, hugged and cried at the news.

"With today's vote, we have disclosed who we are: a generous, compassionate, bold and joyful people," Prime Minister Enda Kenny proclaimed as he welcomed the outcome. Beside him, Deputy Prime Minister Joan Burton declared the victory "a magical moving moment, when the world's beating heart is in Ireland."

Ireland is the first country to approve gay marriage in a popular national vote. Nineteen other countries, including most U.S. states, have legalized the practice through their legislatures and courts.

The unexpectedly strong percentage of approval surprised both sides. More than 1.2 million Irish voters backed the "yes" side to less than 750,000 voting "no." Only one of Ireland's 43 constituencies recorded a narrow "no" majority, Roscommon-South Leitrim in the boggy midlands.

Analysts credited the "yes" side with adeptly employing social media to mobilize young, first-time voters, tens of thousands of whom voted for the first time Friday. The "yes" campaign also featured moving personal stories from prominent Irish people -- either coming out as gays or describing their hopes for gay children -- that helped convince wavering voters to back equal marriage rights.

Both Catholic Church leaders and gay rights advocates said the result signalled a social revolution in Ireland, where only a few decades ago the authority of Catholic teaching was reinforced by voters who massively backed bans on abortion and divorce in the 1980s.

Voters legalized divorce by a razor-thin margin in 1995 and now, by a firm majority, have dismissed the Catholic Church's repeated calls to reject gay marriage. Abortion, still outlawed, looms as the country's next great social policy fight.

Dublin Archbishop Diarmuid Martin said the "overwhelming vote" against church teaching on gay marriage meant that Catholic leaders in Ireland needed urgently to find a new message and voice for reaching Ireland's young.

"It's a social revolution. ... The church needs to do a reality check right across the board," said Martin, who suggested that some church figures who argued for gay marriage's rejection came across as harsh, damning and unloving, the opposite of their intention.

"Have we drifted completely away from young people?" he asked. "Most of those people who voted 'yes' are products of our Catholic schools for 12 years."

David Quinn, leader of the Catholic think-tank Iona Institute, said he was troubled by the fact that no political party and only a half-dozen politicians backed the "no" cause.

"The fact that no political party supported them must be a concern from a democratic point of view," he said.

Fianna Fail leader Michael Martin, a Cork politician whose opposition party is traditionally closest to the Catholic Church, said he couldn't in good conscience back the anti-gay marriage side.

"It's simply wrong in the 21st century to oppress people because of their sexuality," he said.

Some political leaders in Canada approved of the result. Ontario Premier Kathleen Wynne, who is openly gay, and federal NDP leader Tom Mulcair both tweeted congratulations.

ireland referendum

"Especially proud of my Irish roots today. A clear progressive message from voters & resounding victory for equality," Mulcair tweeted.

After the result was announced, thousands of celebrants flooded into the Irish capital's pubs and clubs -- none more popular Saturday night than the city's few gay venues.

At the George, Ireland's oldest gay pub, drag queens danced and lip-synced to Queen and the founding father of Ireland's gay rights campaign, Sen. David Norris, basked in the greatest accomplishment of the movement's 40-year history.

"The people in this small island off the western coast of Europe have said to the rest of the world: This is what it is to be decent, to be civilized, and to be tolerant! And let the rest of the world catch up!" Norris, 70, shouted with jubilant zeal to the hundreds packing the disco ball-lit hall.

In the 1970s and 1980s, Norris waged an often lonely two-decade legal fight to force Ireland to quash its Victorian-era laws outlawing homosexual acts. Ireland finally complied in 1993, becoming the last European Union country to do so. This time, the gay community in Ireland managed to build a decisive base of support.

"People from the LGBT community in Ireland are a minority. But with our parents, our families, or friends and co-workers and colleagues, we're a majority," said Leo Varadkar, a 36-year-old Irish Cabinet minister who in January announced on national radio that he was gay. "For me it wasn't just a referendum. It was more like a social revolution."

Many gay couples took the moment to declare their intentions or renew their vows. One lesbian couple in Limerick proposed on bended knee at the vote count there, while one of Ireland's most prominent advocates for gay marriage, American-born Sen. Katherine Zappone, asked her wife live on Irish TV: "Today in this new Ireland, Ann Louise Gilligan, will you marry me?"

The couple, who met at Boston College and already were married legally in Canada in 2003, sued Ireland unsuccessfully in 2006 to have their marriage recognized as valid. Once parliament passes enabling legislation by this summer, that Canadian wedding license will become legal in Ireland. But Zappone and Gilligan, a former nun, still plan an Irish ceremony.

"There's nothing like an Irish wedding," Zappone said.

The Dublin Castle crowds saved their greatest roars of approval for Panti Bliss, Ireland's most famous drag queen, who strode gingerly into the castle's central square in high heels and a body-hugging floral dress to conduct a joint live interview on Irish TV beside Justice Minister Frances Fitzgerald and Sinn Fein party chief Gerry Adams.

"It feels like we asked the whole country to marry us and they just said yes," said Panti, aka Rory O'Neill, who in a viral-internet speech last year inspired a national debate on the level of homophobia in Irish society.

"Today's vote isn't actually for 46-year-old aging drag queens like me. This vote is about all the young faces out there," Panti said, gesturing to the square-full of mostly 20-something onlookers, some donning rainbow-colored feather boas and parasols. Panti said that within a few years going to a gay marriage "will become an ordinary, normal part of life -- and that's what changes hearts and minds."

When asked whether she -- Panti's preferred gender of pronoun -- intended to marry, the already surreal scene turned flirty. "Sure, why not, if I can find the right fella," Panti said, slyly putting an arm around a beaming Adams. Laughter cascaded through the crowd.

Political analyst Sean Donnelly, who has covered Irish referendums for decades, said Saturday's landslide marked a stunning generational shift. He noted that two decades ago in Ireland's last tortuous vote challenging a benchmark Catholic teaching, voters barely approved divorce -- but only because heavy rain deterred voters in the then-conservative west. More than half of Ireland's constituencies recorded "no" majorities to divorce.

Not this time. Even far-flung Donegal in Ireland's northwest corner, renowned for its reactionary record of voting against the national mood, voted "yes" to gay marriage.

"We're in a new country," Donnelly said. "When I was reared up, the church was all powerful and the word 'gay' wasn't even in use in those days. How things have moved from my childhood to now."

With files from The Canadian Press