Finland's leftist Social Democrats won first place in Sunday's general election with 17.7% of the votes, avoiding a near defeat by the far-right Finns Party, which rose in the ranks with an anti-immigration agenda.
The Social Democrats led by former trade union leader Antti Rinne, picked up 40 seats in parliament. Their campaign was built on fierce opposition to the austerity imposed by the previous centre-right government of Prime Minister Juha Sipila.
The Finns Party picked up 39 seats under the leadership of MEP Jussi Halla-aho.
In a razor-thin victory, only 0.2 percentage points separated the two parties. The Social Democrats will now head a government for the first time in 16 years.
The Finns Party more than doubled its presence in parliament, from 17 to 39 seats, regaining almost all the ground lost when more than half of Finns Party MPs fled the party in 2017.
During the campaign, Rinne had said he would find it "very difficult" to enter a coalition with the far-right party but after declaring victory on Sunday he did not rule out a collaboration saying he had "questions" for the party.
Finland usually has a government made up of three or four parties who form the minimum 101-seat majority in parliament.
Rinne could also enter into a coalition with the conservative National Coalition party, who came in third place with 38 seats.
The parties might be able to put their difference aside to stop the Finns Party from trying to form a government, political commentator Sini Korpinen told the AFP.
The Ministry of Justice will confirm the election results on Wednesday, said a tweet by the Finnish Parliament.