Irish poet and human rights activist Michael D. Higgins was officially confirmed as his country's ninth president on Saturday after a marathon two-day count.
The 70-year-old former culture minister for the Labour party, the junior partner in the coalition government in Dublin, beat off a ex-IRA commander and a reality TV star to succeed Mary McAleese in the ceremonial post.
At the Dublin Castle count centre, returning officer Riona Ni Fhlanghaile declared Higgins elected after he accumulated 1,007,104 votes after four counts, on a turnout of 56 percent.
Under Ireland's complicated election system, the winner needed at least 885,882 votes, which represents 50 percent of the valid votes plus one.
"As he has reached the quota I hereby declare Michael D. Higgins elected to the office of president of Ireland," Ni Fhlanghaile said.
Higgins took 39.6 percent of the first preference vote in the ballot on Thursday, and was named the de facto winner when his main rival, Sean Gallagher, conceded on Friday afternoon.
The victory represents a remarkable turnaround for Higgins, who was trailing about 15 points behind Gallagher before the independent businessman's campaign exploded in the final days of the campaign.
During a stormy televised debate on Monday, Sinn Fein candidate and former IRA commander Martin McGuinness accused Gallagher of collecting a 5,000-euro ($7,000) donation from a convicted criminal -- and his lead melted away.
A poll showed 28 percent of voters changed their minds in the final week of the campaign, with 58 percent of them switching from Gallagher to Higgins.
Married with three sons and a daughter, Higgins is a fluent Irish speaker, president of the soccer club in his Galway base in the west of Ireland and has had three books of poems published.
He recited his poetry on a live album by Irish rock band, The Stunning, and was a columnist for Irish music magazine Hot Press.
When he was arts minister in the 1990s he boosted the country's film industry, established an Irish language TV station and set up arts centres and theatres around the country.