They hugged, they cheered, they cried at the news.

Celebrations rocked Dublin, the Irish capital, into the wee hours Sunday after citizens voted in a landslide to legalize gay marriage - a stunningly lopsided result that political observers called "a social revolution."

Friday's referendum saw 62.1 percent of Irish voters say "yes" to changing the nation's constitution to define marriage as a union between two people regardless of their sex. With the move, Ireland became the first country in the world 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.

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

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 signaled 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 only by a razor-thin margin in 1995 but now, by a firm majority, 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.

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

After the result was announced Saturday, thousands of celebrants flooded into the Irish capital's pubs and clubs. 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 into the castle's central square in high heels and a body-hugging floral dress for 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, whose viral Internet speech last year inspired a national debate on 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.

Panti predicted that, within a few years, going to a gay marriage in Ireland "will become an ordinary, normal part of life - and that's what changes hearts and minds."