Ireland has voted in favour of allowing same-sex marriage after a referendum with one of highest turnouts in its history at more than 60 per cent.
The country is the first to legalise same-sex marriage by a popular vote. Those in favour outnumbered those against by around two to one.
Ireland's minister for health, Leo Varadkar, told the broadcaster RTE that it had been "almost like a social revolution".
Dublin Castle's upper courtyard was opened to 2,000 to the different counties' declarations on a large screen.
Voters were asked whether they agreed with the statement: "Marriage may be contracted in accordance with law by two persons without distinction as to their sex."
The referendum was held only 22 years after Ireland decriminalised homosexual acts and only five years after it introduced civil partnership legislation.
The move to introduce gay marriage was resisted by the Roman Catholic Church. However, the Church was realistic about its loss of influence and credibility following a string of revelations about abuse carried out by priests and in orphanages and institutions. Before the vote, the Bishop of Derry, Rt Rev Donal McKeown, said in a radio interview: "I would hate for people to vote no for bad reasons, for sort of bigoted reasons, for nasty reasons, for bullying reasons. People have to make up their own mind, and I'm quite happy that they can do that in front of God, be it yes or be it no."
Fr Tony Flannery, a Roman Catholic priest in favour of the same-sex marriage legislation, told Christian Today that the vote was "amazing".
He said: "This is a conclusive indication that the power of the bishops in Ireland is gone. Even the older generation is not listening to them any more. The young generation came out in force; some even came home from abroad to vote. A new, and very different, Ireland has become a reality today."
He added: "The challenge for the Church leaders now is to tune in to this new Ireland. I am not hopeful they have the capacity to do so."
Fr Seamus Aherne, who opposed it, said that he was happy to see that so many young people engaged with the issue and voted. However, he said that a 'no' vote was not anti-gay, but reflected the view that marriage was "about a man and woman and consequently about children". He argued that existing civil partnership legislation was the basis for total equality and that the 'yes' vote had been driven by "emotional certainties".
He added: "It seems to me that we as a nation, we are trying to hard to catch up; to be show our maturity; to show our concern for others; to show our modernity. It is as if we are apologetic for treating people so badly in the past (and we did). We must now make up for our failures."
He also said that the Association of Catholic Priests to which he and Flannery belong had "split down the middle" on the issue and that "both views were understandable and acceptable".
Aherne said that the Church needed to "listen to what had happened". "We have been disgraceful in how we treated gay people. We need to learn. We need to live the Gospel. We need to pay attention to the words of Francis or much more importantly - listen to Jesus Christ. He mixed with everyone. He accepted people as they were. He sat at table with everyone. He didn't condemn. He understood the mess that is life and is the life of most of us. Simplicity or rigidity or certainty is never the lot of humanity. It cannot be the view of a living Christian."
He concluded: "The sun still shines. The rain still comes. We all go about our business. We make our arguments and then accept what happens. No one has died. It isn't the death of life or family or marriage as we know it."