Ireland's first openly gay prime minister, Leo Varadkar, resigned on Thursday.

According to the BBC, Varadkar acted after his Fine Gael party lost 15 seats in the general election held earlier this month.

After the Irish Parliament failed to name his replacement, Varadkar submitted his resignation, though he'll remain in the post in a caretaker role until a successor is named.

Varadkar, 41, in 2017 became Ireland's first openly gay prime minister, and the youngest. Two years earlier, Varadkar, the son an immigrant Indian father and Irish mother, came out gay as Ireland debated a nationwide referendum on whether to extend marriage rights to gay and lesbian couples. Voters approved the measure with an overwhelming (62%) majority.

(Related: Irish PM Leo Varadkar to raise same-sex marriage with Pope.)

Varadkar's exit leaves Luxembourg Prime Minister Xavier Bettel, the first European Union leader to marry a person of the same sex while in office, as the only openly gay head of state. Belgium and Iceland have previously been helmed by a gay leader.

(Related: In UN speech, Luxembourg PM Xavier Bettel says homophobia is a choice.)