The Social Democratic Party (SDP) has narrowly won Finland's general election with 17.7% of the vote.
But the far-right Finns Party was close behind on 17.5%, while the Centre Party of outgoing PM Juha Sipila saw its support crash by a third to 13.8%.
"For the first time since 1999 we are the largest party in Finland," said SDP leader Antti Rinne.
But with the vote split and no party winning by a clear margin, it may be hard to build a workable coalition.
The Greens and the Left Alliance also increased their share of the vote.
It is the first time in more than a century that no party has won more than 20% of the vote.
Voter turnout was 72%.
The SDP won 40 seats in the 200-seat parliament, one more than the Finns Party.
At the last election in 2015, the Finns Party won 38 seats, but MPs split after a leadership election in 2017.
For Jussi Halla-aho, who has led the Finns Party since then, the rebuilding of the party's parliamentary block was cause for celebration.
"I could not expect a result like this, and no-one could," he told supporters on Sunday evening.
Before the election, most other parties ruled out any coalition with the Finns Party.
Nationalists a force to be reckoned with
By Maija Unkuri in Helsinki
Only three months ago the future didn't seem too promising for the Finns Party. Its support had collapsed to below 10%. The party's former popular leader and foreign minister Timo Soini had left his creation.
Jussi Halla-aho is best known for criticising most kinds of immigration. The Finnish Supreme Court has sentenced him to fines for extreme opinions in his blog. Now he and his party seem eager to be part of a new government. But the SDP's Antti Rinne isn't likely to invite them in.
It's obvious the Finns Party won second place over two issues: its main focus was to criticise immigration; and a little more unexpectedly, its position on climate change had an impact.
A wide range of Finnish parties from right to left urged more intensive efforts to combat climate change. But the Finns Party was the exception: it thinks Finland has already been ambitious enough. It does not deny climate change, but argues that the burden of trying to stop it should be spread evenly worldwide.
How did we get here?
Last month, Mr Sipila's government resigned over its failure to achieve a key policy goal on social welfare and healthcare reform. His Centre Party had been in a centre-right coalition government since 2015.
Concerned about Finland's expensive welfare system in the face of an ageing population, Mr Sipila made tackling the nation's debt one of his government's main aims, introducing planning reforms he hoped would save up to €3bn (£2.6bn; $3.4bn) over a decade.
But while the introduction of austerity measures - such as benefits cuts and pension freezes - resulted in Finland reducing its government debt for the first time in a decade last year, the reforms proved politically controversial.
Meanwhile, the SDP, a centre-left party with strong links to Finland's trade unions, saw its popularity grow.
The SDP campaigned on a pledge to strengthen Finland's welfare system. Mr Rinne promised to raise the state pension for those taking home €1,400 a month by €100, a move he said would help "more than 55,000 pensioners escape poverty".
Balancing taxes and spending is problematic for any government, and Finland has relatively high taxes.
The top personal income tax rate is 51.1%. However, the average income tax rate, at 30%, is not the highest in Europe, according to OECD data.
A poll commissioned by the tax authority in 2017 found that 79% of Finns questioned were happy with their taxes.
Why is Finland's welfare system an issue?
Like many developed nations, Finland has an ageing population that is putting financial pressure on its social welfare systems.
As an increasing number of people live longer in retirement, the cost of providing pension and healthcare benefits can rise. Those increased costs are paid for by taxes collected from the working-age population - who make up a smaller percentage of the population than in decades past.
In 2018, those aged 65 or over made up 21.4% of Finland's population, the joint fourth highest in Europe alongside Germany - with only Portugal, Greece, and Italy having a higher proportion, according to Eurostat.
Finland's welfare system is also generous in its provisions, making it relatively expensive. Attempts at reform have plagued Finnish governments for years.
In February this year, caring for the nation's elderly returned to the top of the political agenda amid reports that alleged neglect in care homes may have resulted in injury or death, according to broadcaster YLE.
What are the other key issues?
Immigration has become an important topic following reports of alleged sexual assaults by foreign men. As a result, support has risen for the Finns Party, which has promised to cut immigration and enforce stricter asylum rules. Other parties have also pledged to crack down on migrants who commit crime.
Another key issue is climate change. Following the release of an Intergovernmental Panel on Climate Change, almost all parties have vowed to keep global warming to 1.5 degrees, the New York Times reports.
But the Finns Party did not campaign for greater environmental controls.
It has also announced an alliance with Germany's far-right AfD, Italy's League party and the Danish People's Party for the European elections in May.