Fianna Fáil will be the biggest party in the 33rd Dáil after the counting finished in General Election 2020 with Cavan-Monaghan the final constituency announcing their result just before midnight.
The Fianna Fáil duo of Brendan Smith and Niamh Smyth took the final two seats as transfers from running-mate Robbie Gallagher saw them over the line.
That brought the party to 38 seats - just one above Sinn Féin. Fine Gael won 35 seats as the major and minor parties must now come together in order to work out how to get to the magic number of 80 for a Dáil majority.
Sinn Féin, who topped the poll in most areas, and Fianna Fáil each had 37 TDs elected but as Ceann Comhairle Seán Ó Fearghaíl was automatically returned, FF will be the top party in when the Dáil resumes.
The Green party took 12 seats, Labour and the Social Democrats six each, Solidarity-People Before Profit will have five TDs and there will be 21 independents in the next Dáil.
Taoiseach Leo Varadkar’s Fine Gael was the big loser, recording one of the worst results in its history, winning only 35 seats having entered the campaign as the largest party on 47.
Despite being edged in seat numbers, Sinn Féin is undoubtedly the party with most to celebrate, having smashed Ireland's long-standing two party system.
Mary Lou McDonald's party triumphed in the popular vote and may have won many more seats – potentially an additional 11 – if it had fielded more candidates in the landmark contest.
Hours before counting finished, Ms McDonald predicted she could be poised to become Ireland's next leader.
On an impromptu walkabout in Dublin city centre, she said: “I may well be the next taoiseach, yes.”
She later told the media: “I think it would be a mighty thing to have a Sinn Féin taoiseach and also a woman perhaps in the job but you might say ‘she would say that wouldn’t she?’”
Despite receiving the most first preference votes, Sinn Féin's place in the next government is not guaranteed.
All three major parties are far short of the 80 seats required for a Dáil majority so, barring another election, some form of coalition is inevitable.
The task of forming a government could be a long and tortuous one and may force either Fianna Fáil or Fine Gael to back-track on long-standing pledges never to do business with Sinn Féin.
Smaller parties and groupings such as the Greens, Labour, the Social Democrats and Solidarity/People Before Profit, and a sizeable number of independent TDs, may all be courted as the main parties seek junior coalition partners.
Ms McDonald’s preference is for a coalition of left-wing parties and independents, without any input from the centre right Fianna Fáil and Fine Gael.
However, it remains doubtful whether such an alliance could generate sufficient numbers for a majority.
A coalition of Fianna Fáil, Sinn Féin and the Green Party, which ended with 12 seats, is seen by many as the most likely option.
But on Monday a senior Fianna Fáil politician described a coalition with Sinn Féin as “untenable”.
Jim O'Callaghan also insisted his party leader Mr Martin had not softened his stance on ruling out the party as government partners.
Mr O'Callaghan's views are not echoed by all his colleagues, with some Fianna Fáil members having indicated a willingness to do business with the Sinn Féin.
Mr Varadkar has maintained his pre-election stance and ruled out any Fine Gael/Sinn Féin coalition.
Another permutation could see the exclusion of Sinn Féin, with Fine Gael and Fianna Fáil entering power together in a so-called “grand coalition” with another smaller party or grouping – though that prospect looks increasingly unlikely.
Ms McDonald has pledged to work to form a “people’s government” and get to grips with crises in housing and health – the issues that featured so prominently on the campaign trail.
“This election has certainly been seismic and historic, it’s been an election that’s really been driven by a demand for change by the people,” she said.
Sinn Féin received 24.5% of the vote share on first preference in Saturday’s election, Fianna Fail got 22.2% and Fine Gael 20.9%.
The final breakdown of the 160 seats is Fianna Fáil 38, Sinn Féin 37, Fine Gael 35, Greens 12, Labour 6, Social Democrats 6, Solidarity/People Before Profit 5, Aontú 1, Independents4Change 1 and independents 19.
Yesterday, Fine Gael Finance Minister Paschal Donohoe said no party had an automatic right to govern.
“It is clear that no political party in our country has a monopoly on representing the people of Ireland,” he said.
On Sunday, Mr Martin declined to repeat his pre-election pledge never to do business with Sinn Féin.
He later cautioned observers not to “jump the gun” in interpreting his remarks as a signal an alliance with the party was in the offing.
Mr Varadkar’s last government, a minority Fine Gael-led administration that included several independent TDs, was sustained in power through a historic confidence and supply arrangement with Fianna Fáil.
That pact between two parties took 70 days to negotiate following the inconclusive 2016 general election.
It looks unlikely that either party will countenance a similar arrangement this time round.