Fianna Fáil has won the most seats in the Irish general election just one ahead of Sinn Féin, who recorded a historic result.
Sinn Féin's haul of 37 seats is an increase of 14 on the 2016 election.
Fine Gael, whose party leader Leo Varadkar led the outgoing government as taoiseach (Irish prime minister), finished with 35 seats, down 15 from four years ago.
The tight numbers could lead to lengthy negotiations to form a government.
The election results were confirmed shortly after midnight when two Fianna Fáil candidates, Brendan Smith and Niamh Smyth, won the last two seats in Cavan-Monaghan.
The final results showed that:
- Sinn Féin had won 37 seats, an increase of 14 on the 2016 election
- Fianna Fáil had lost six seats since 2016 but became the largest party by one seat
- Fine Gael lost 15 seats from 2016
- The Green Party recorded their best ever election result, winning 12 seats - an improvement of 10 from 2016
The outcome was described as "something of a revolution in the ballot box" by Sinn Féin leader Mary Lou McDonald.
With all first preferences counted, the left-wing republican party has taken 24.5% of the vote, compared to 22% for Fianna Fáil and 21% for Fine Gael.
Before the election, both Fine Gael and Fianna Fáil had ruled out forging a coalition with left-wing republican party Sinn Féin, citing its tax policies and IRA past as deterrents.
On Sunday, taoiseach (Irish PM) and Fine Gael leader Leo Varadkar conceded it would be "challenging" to form a government.
Fianna Fáil leader Micheál Martin did not rule out working with Sinn Féin, but said "significant incompatibilities" still existed.
Sinn Féin President Mary Lou McDonald, who topped the poll in her four-seat Dublin Central constituency, said Sinn Féin wanted to be in government and was working to establish if the numbers were there to deliver it without Fianna Fáil or Fine Gael.
On Monday evening, she said she had not heard from the leaders of those two parties and has instead been speaking to Labour, the Green Party and other smaller parties that make up the Dáil (Irish parliament).
"People want different politics, new politics and better government - a new government - and I believe Sinn Féin will be the core of that," she told reporters in Dublin.
"I may well be the next taoiseach," she added.
Speaking to BBC Newsnight, Mrs McDonald also said she believed constitutional change was coming.
"The point has been conceded in the Good Friday agreement by the British state - the presence here is solely on the basis of consent," she said.
"That consent can only be tested in a unity referendum and we are going to have a unity referendum - and I want us to do it in an orderly, thoughtful democratic and absolutely peaceful manner."
Sinn Féin's vice-president, Michelle O'Neill, said the party would have "asks in terms of the republican project", in line with its repeated calls for the next government to prepare for Irish unity.
Why the Sinn Féin surge?
Left-leaning Sinn Féin managed to successfully tap into the public anger felt in the Republic of Ireland over issues that have dogged centre-right Fine Gael for a number of years - a shortage of housing, rocketing rents and homelessness, analysts suggest.
That is despite the fact the country is forecast to have one of the fastest growing economies in the EU in 2020.
They were dubbed "the problems of success" by former Finance Minister Michael Noonan as far back as 2015.
Brexit - a considerable focus of Leo Varadkar and his deputy Simon Coveney while in power - barely registered as an issue in the campaign.
Democratic Unionist Party (DUP) leader Arlene Foster, whose party is in a power-sharing government with Sinn Féin in Northern Ireland, said younger voters had backed Sinn Féin as a "protest vote".
"From a Northern Ireland perspective we will have to work with whoever the government is in the Republic of Ireland," Mrs Foster told BBC News NI.
She also said Sinn Féin may have their focus on Northern Ireland questioned, in the way there had been a "wailing and gnashing of teeth" over her party's confidence-and-supply agreement with the previous Conservative government in the UK.
Sinn Féin's best-ever result is the success story of this election.
However, with how the overall votes have fallen, we know that Sinn Féin will not necessarily end up in government despite its swathe of victories.
The magic number for winning a majority government in the Republic of Ireland is 80 seats.
None of the three big parties - Fine Gael, Fianna Fáil and now Sinn Féin - will come close to that figure.
Attempts to form a new coalition-of-sorts will formally get under way, although this will be complex.
Previous administrations in the Republic of Ireland have been forged this way too, but it's taken a while to get there.
In 2016, it took 70 days for a government to be formed after the parties agreed a confidence-and-supply agreement, which saw a Fine Gael-only cabinet, propped up by Fianna Fáil votes on key policy areas.
Sinn Féin's vote has increased dramatically - winning 37 seats out of the 42 seats it stood candidates in and topping the poll in 30 constituencies.
Following the last election in 2016 Sinn Féin had 23 seats in the Dáil.
Fine Gael has been in government since 2011, firstly with the Labour Party and then with independents and since 2016, a confidence-and-supply deal with Fianna Fáil.
Varadkar acknowledges 'three-party system'
It looks set to lose seats for the second election in a row, but that does not necessarily rule it out of forming another government.
Its share of first preference votes dropped from 25.5% at the last election to 20.9%.
The taoiseach said he was "not really" disappointed that he did not top the poll in his own constituency. He did get an increase in his votes compared to the last election.
He added it was clear there was now a "three-party system".
On Sunday Micheál Martin said reports suggested his party "would be the largest" but that it was early days and that he respected the will of the people.
What about the smaller parties?
The Green Party has increased the number of seats it holds, jumping from two seats in the last election to 10.
Green leader Eamon Ryan, who was elected for Dublin Bay South, said his party would play its part in talks to form a government.
The Green Party secured 7.1% of first preference votes, followed by Labour (4.4%), Social Democrats (2.9%), Solidarity-People Before Profit (2.6%).
Aontú (1.9%) independents (12.2%) and others (1.3%) accounted for the rest.