Estonia’s hardline interior minister and nationalist party leader has narrowly survived a vote of confidence triggered by uproar in the Baltic country at his mocking of the new female prime minister of Finland, a close neighbor, and her Social Democratic party.

Lawmakers at the 101-seat Riigikogu, Estonia’s parliament, voted Tuesday by 44 to 42 to remove Mart Helme from his post. However, the motion failed to pass because it did not achieve an absolute majority of 51.

The move was initiated by the opposition Reform Party.

Helme, 70, in an interview with an Estonian radio talk show on Sunday, made a jibe at Sanna Marin, Finland’s new 34-year-old prime minister, saying “a cashier” was now leading Estonia’s close neighbor an apparent reference to Marin’s stint at a department store earlier in her career.

Helme, 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 Finland’s third female government leader.

Estonian President Kersti Kaljulaid on Monday phoned her Finnish counterpart Sauli Niinisto, offering a public apology on behalf of Estonia and Helme to Marin and her government. Helme himself apologized only much later Monday, blaming media for overplaying his comments.

The incident nearly led Monday to the collapse of Estonia’s three-party coalition led by Prime Minister Juri 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 Monday but announcing that his Cabinet would continue its work with no changes.

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