Leo Varadkar will remain prime minister in a caretaker role | Donall Farmer/Getty Images Irish parliament votes against all 3 party leaders becoming PM Leo Varadkar to resign but remain as caretaker prime minister.

The leaders of Ireland's three largest political parties faced parliamentary votes Thursday to see if they had enough support to become prime minister — but none of them did.

A surge in support for Sinn Féin in this month's election saw the left-wing nationalist party win the popular vote, sweeping away the traditional dominance of Fine Gael (the party of Prime Minister Leo Varadkar) and Fianna Fáil. In the final count, Sinn Féin had 37 seats, Fianna Fáil 38, and Fine Gael 35.

Varadkar was the first to face lawmakers on Thursday. He received 36 votes in favor but 107 members of parliament voted against him remaining as prime minister and 16 abstained, the Irish Times reported.

The parliament also voted against the election of Fianna Fáil leader Micheál Martin as prime minister by 97 votes to 41 with 19 abstentions.

Sinn Féin leader Mary Lou McDonald also failed, but she received the most votes of any of the leaders with 45 in favor, 84 against and 29 abstentions.

As a result of the voting, Varadkar will now resign but remain as caretaker prime minister.

Coalition talks will continue.