Estonia’s nationalist interior minister has narrowly survived a vote of confidence triggered by uproar in the Baltic country at his mocking of the new prime minister of Finland.

Lawmakers at the 101-seat Riigikogu, Estonia’s parliament, voted 44-42 to remove Mart Helme from his post. However, the motion failed to receive the absolute majority of 51 required for passage.

The move was initiated by the opposition Reform party. Its leader Kaja Kallas said Helme “has repeatedly injured the reputation of the Estonian state [and] if we let him go on as minister, he’ll be able to humiliate Estonia even further”. Kallas added that her call for him to quit was supported by other opposition parties and even a lawmaker in the governing coalition.

Sanna Marin. Photograph: Thierry Roge/Belga/Zuma Press/Rex/Shutterstock

In an interview with an Estonian radio talk show on Sunday, Helme, took a swipe at the Finnish prime minister, Sanna Marin, 34, saying “a sales girl” was now leading Estonia’s close neighbour, an apparent reference to Marin’s past stint working at a department store.

The 70-year-old, a historian and Estonia’s former ambassador to Russia, also mocked Marin’s ruling “red” Social Democratic party, saying it was out to “liquidate” Finland with its policies.

Marin last week became the world’s youngest sitting prime minister and the third woman to lead Finland’s government.

The Estonian president, Kersti Kaljulaid, on Monday phoned her Finnish counterpart Sauli Niinistö, offering a public apology on behalf of Estonia. Helme apologised only much later on Monday, blaming the media for overplaying his comments.

The incident nearly led to the collapse of Estonia’s three-party coalition led by the prime minister Jüri Ratas of the Center party, who was urged by Kaljulaid to fire Helme.

However, Ratas refused to do so, offering his government’s apology to Finland on Monday but announcing that his cabinet would continue its work with no changes.

Helme is known in Estonia for his political gaffes and sexist comments about women, including personal attacks on Kaljulaid, Estonia’s first female president, whom he called earlier this year “an emotionally heated woman”.

He is the chairman and co-founder of the nationalist, anti-immigrant Estonian Conservative People’s party, or EKRE, which emerged from a March election as Estonia’s third-largest party.

His son Martin Helme is the party’s vice chairman and the Baltic nation’s current finance minister. Three EKRE ministers have resigned from the cabinet over various scandals since the government took office in April.

Along with EKRE and Ratas’ Center party, the three-party majority coalition includes the conservative Fatherland party.