(Bloomberg) -- Latvia’s parliament elected long-time Foreign Minister Edgars Rinkevics as the Baltic nation’s new president, making him the European Union’s first openly gay head of state. 

Fifty-two lawmakers in the 100-seat legislature in Riga voted for Rinkevics, who has served as Latvia’s top envoy for almost 12 years, to succeed President Egils Levits. Appointed by Prime Minister Krisjanis Karins’s ruling party earlier this month, Rinkevics has been a consistent advocate for supporting Ukraine and a strident critic of the Kremlin. 

“I will do everything so that our state will thrive, our country is safe and our society will be more united,” Rinkevics said after the vote. He encouraged Latvia’s youth to “be ready to break the glass ceiling” in pursuing their ambitions. 

In 2014, he became the first top official in the Baltic nation of 1.9 million to announce that he was gay. While the 27-member bloc has had several gay prime ministers — including Ireland’s Leo Varadkar and Xavier Bettel of Luxembourg — Rinkevics would be the first in a member state’s highest office.

San Marino, a microstate of 34,000 in central Italy, elected openly gay Paolo Rondelli to be one of its two heads of state, or captains regent, in 2022. 

The Baltic region has trailed other parts of Europe in advancing rights for LGBTQ people. A bill in Latvia’s parliament that would approve civil unions has stalled despite a ruling by the Constitutional Court granting rights to same-sex couples. 

In neighboring Estonia, lawmakers are on the verge of approving the legalization of gay marriage, which would make the country the first former Soviet republic to do so. 

Latvia’s presidential succession prompted political gridlock, with Karins’s coalition government unable to settle on a single candidate. The dispute may prompt the premier to forge a new government. 

Rinkevics started as a top civil servant in the Defense Ministry and went on to become chief of staff for then-President Valdis Zatlers. 

(Updates with Rinkevics’s comment in third paragraph.)

©2023 Bloomberg L.P.