INDEPENDENT TD Catherine Connolly has been elected as the Dáil's Leas Cheann Comhairle in a shock result that saw the government candidate defeated.
Ms Connolly beat Fine Gael candidate Fergus O'Dowd by a narrow 77 votes to 74 in the secret ballot of TDs.
The Galway West TD will be the first woman to hold the prestigious role.
The result means that some government TDs either didn't vote or cast their ballot in support of Ms Connolly.
In total, 151 of the Dáil's 160 TDs voted.
If all government TDs had voted in Mr O'Dowd's favour he would have won with 84 votes.
The Opposition has 73 votes between them so the result indicates that at least four government TDs voted for Ms Connolly.
The result is embarrassing for the Fianna Fáil/Fine Gael/Green coalition.
Independent.ie understands that Fianna Fáil TDs were told to vote for Mr O'Dowd at their parliamentary party meeting last night.
Taoiseach Micheál Martin said of Catherine Connolly’s surprise elevation: "I’m surprised that Ferguson (O’Dowd) didn’t get elected. I supported him.
"It is a secret ballot, and that speaks to the autonomy of Parliament. I can’t speculate any further than that. I am disappointed for Fergus, who is a very experienced politician."
Speaking on Prime Time this evening, Tánaiste Leo Varadkar said he was "devastated" for Fergus O'Dowd.
"I'm devastated for Fergus, I thought he would win this, we all thought he would win it.
"Obviously, I want to offer my congratulations to Catherine Connolly, who did win.
"There were four government TDs absent, but there were also a number who clearly didn't vote for Fergus either. It was a secret ballot, I don't know who didn't vote for him, but it is disappointing," he said.
He added that Mr O'Dowd is a "parliamentarian of enormous standing" and that he would have done a "great job" in the role.
Independent TD Thomas Pringle - a supporter of Ms Connolly - said of the result: "obviously government TDs voted for Catherine".
He said he is delighted for his Independent colleague saying it's a great day for her and shows the high esteem she's held within the Dáil.
Mr Pringle didn't speculate as to who on the government benches backed Ms Connolly saying: "we'll all be looking to try and figure out who that is".
He argued that it showed that in a secret ballot the government couldn't whip its own votes.
He said the role of Leas Cheann Comhairle should be "above party allegiance" and Ms Connolly will be "fair to everybody".
Mr Pringle added: "Being a member of the Opposition it shows that the Dáil has a bit of independence as well."
He suggested that if the vote had been in public the government TD would have won but "because it was a secret ballot people had their own say".
This morning, Ms Connolly said she was standing in the election on her record as a politician since 1999 including a stint as the Mayor of Galway and her time as a TD since 2016.
She also said: "In 101 years, there has never been a female in the Chair, either as Ceann Comhairle or as Leas-Cheann Comhairle."
Ms Connolly said that apart from the Taoiseach, ministers and Opposition leaders, the Ceann Comhairle and the Leas-Cheann Comhairle are "the most visible aspect of our democracy."
She said: "They are what the people of Ireland see, and it is important that we have gender equality in that role."
Ms Connolly promised to be "fair and just" if elected.
A former member of the Labour Party, Ms Connolly has made a name for her forensic questioning as a member of the Dáil's Public Accounts Committee (PAC).
The role of Leas Cheann Comhairle comes with a €38,787 allowance on top of the standard TD's salary of €96,189.