Finland's 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.
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.