DUBLIN -- Gays in Ireland often have faced a stark choice between leading secret lives or emigrating to more liberal lands. This week, the Irish could turn that tradition on its head and vote to legalize same-sex marriage in the world's first national referendum on the matter.

The campaign ahead of Friday's constitutional referendum has featured searing testimonies designed to make the voters of this predominantly Roman Catholic nation look in the mirror. Members of many of Ireland's most prominent families have come out of the closet in hopes of challenging their neighbours' attitudes to homosexuality. The contest has pit the waning power of the Catholic Church against the secular-minded government of Prime Minister Enda Kenny.

"A yes vote costs the rest of us nothing. A no vote costs our gay children everything," former President Mary McAleese said at a gay rights event in Dublin this week after her only son, a 30-year-old airline executive, revealed he is gay. McAleese, a canon law scholar and former legal adviser to the church, spoke of her son's experience of bullying and isolation as a teenager, and of friends who learned that their own sons were gay only when they tried to kill themselves.

The government's campaign effectively began in January with a 36-year-old Cabinet minister, Leo Varadkar, declaring his homosexuality so that he could campaign for a "yes" vote from a position of honesty.

The public confessional has been busy ever since. A steady stream of entertainers, sports stars and political and business leaders have told their stories of coming out to parents and siblings, or of learning that a close friend or relative was gay. Most say they kept their true sexual identity secret to avoid ostracism, intimidation or even criminal sanction in a country that, until 1993, outlawed homosexual acts.

"For too long now, people haven't been able to be true to themselves," said Conor Cusack, who is one of the few openly gay athletes in Ireland's native Gaelic sports scene. In media debates, Cusack has challenged the views of other well-known sportsmen who say they'll vote no.

"Emotionally, I have been in a prison since the age of 17; a prison where I lived a half-life, repressing an essential part of my humanity, the expression of my deepest self; my instinct to love," wrote Ursula Halligan, one of Ireland's best known political correspondents. She came out as a lesbian this month at age 54.

"At every turn society assumes and confirms heterosexuality as the norm. This culminates in marriage when the happy couple is showered with an outpouring of overwhelming social approval. For me, there was no first kiss; no engagement party; no wedding," she wrote. "And up until a short time ago, no hope of any of these things."

Gay marriage is legal in 19 countries, including Britain and most of the United States. Three U.S. states used referendums to help enact their laws, but Ireland is the first to hold a nationwide popular vote.

Ireland legally must do this because of its conservative 1937 constitution written by then-Prime Minister Eamon de Valera in collaboration with Catholic church leaders. Its family section proclaims inalienable rights for married couples, but doesn't specify that a marriage must be between a man and a woman -- an omission that reflects the age's social assumptions and invisibility of gays in public life.

While some politicians called for the government to legislate directly for gay marriage, Kenny's attorney general advised that any changes in marriage law would have to be approved by referendum and formally added to the constitution, lest it be challenged as unconstitutional.

Ireland's previous government in 2010 did legalize civil partnerships for gay couples, resolving problems involving property ownership, pensions, tax benefits and other financial matters. But a constitutional reform commission in 2013 recommended legalization of full-fledged marriage for gays, citing more than 150 shortcomings with civil partnerships, and Kenny backed the recommendation.

His government's proposed amendment to permit marriages of "two persons without distinction as to their sex" requires a simple majority of referendum votes to become law.

While opinion polls have consistently shown that most voters support the change, the "yes" side's lead has narrowed this month as religiously conservative campaigners raise fears that gay marriage could endanger children.

"No" campaigners have plastered lamp posts with posters arguing that civil partnerships should be good enough for gays. Other ads warn that unregulated surrogate pregnancies would flourish in a more gay-friendly Ireland, and judges could order children to be seized from single mothers and handed over to adoptive gay couples.

"A mother's love is irreplaceable, vote NO," advises one placard depicting a red-haired boy hugging his mom. "Two men can't replace a mother's love," advises another poster produced, with a tinge of irony, by a pressure group called Mothers and Fathers Matter.

Ireland's independent Referendum Commission, tasked with providing objective information for both sides of every referendum question, has rejected the "no" camp's claims on child endangerment issues as nonsense. It notes that under existing law, gay couples already have the ability to adopt and have children through in-vitro fertilization or surrogacy arrangements.

Another ubiquitous "no" campaign poster, portraying a heterosexual couple kissing a baby on each cheek under the message "Children Deserve a Mother and a Father, Vote No," caused some embarrassment to Mothers and Fathers Matter when it was revealed that the baby-kissing picture came from a stock photo agency -- and the real-life British couple protested that their family portrait shouldn't be used to promote anti-gay bigotry.

"This family believes that everyone has a right to marry the person they love regardless of their gender ... and this family would vote 'yes'," the couple said in a statement distributed by Amnesty International, which is campaigning for gay marriage.

The Catholic Church, its authority weakened by declining Mass attendance and two decades of child abuse coverup scandals, still wields influence in Ireland, particularly in schools and in the rural west of Ireland, where polls indicate anti-gay marriage sentiment runs highest. Priests at weekend Masses read out bishops' pastoral letters from the pulpit asking worshippers to reject the proposed amendment.

In a joint statement, Ireland's bishops said gay marriage would place "the union of two men, or two women, on a par with the marriage relationship between a husband and wife which is open to the procreation of children."

Failure to stop this, the bishops forecast, would mean it becomes "increasingly difficult to speak any longer in public about marriage as being between a man and a woman. What will we be expected to teach children in school about marriage? Will those who sincerely continue to believe that marriage is between a man and a woman be forced to act against their conscience?"

But even within the church, some priests and nuns have said their leaders are wrong, and they'll vote yes. Dublin's politically savvy archbishop, Diarmuid Martin, has offered a more nuanced defence of traditional marriage. He says the faithful should examine their own consciences when casting their ballots Friday.

"I know that the severity with which the Irish church treated gay and lesbian people in the past, and in some cases still today, makes it difficult for some to understand the church's position," Martin said.