Edgars Rinkevics has been elected Latvia’s new president by the country’s parliament, making him the European Union’s first openly gay head of state.

The 49-year-old, who currently serves as the Minister of Foreign Affairs, will take office on 8 July.

He will also make history as the first openly gay president in the Baltic nations.

Rinkevics received 52 votes from Latvia’s 100-seat Saeima legislature, one more than required to win the presidency.

“I am honoured and humbled to be elected as President of the Republic of Latvia, I will do my best to serve the people of Latvia well,” he wrote on social media on 31 May. “I thank Members of Parliament for their trust.”

READ MORE: Trans rights gain ground despite rising European rhetoric

Rinkevics previously served as a state secretary within the Defence Ministry and, in the 1990s, worked as a journalist, among other things.

He has been well received by the Latvian public during his time as Minister of Foreign Affairs for his support of Ukraine and tough stance towards Russia.

ILGA-Europe’s annual ‘Rainbow Europe’ index ranked Latvia 37th out of 49 European countries based on where the best place to be LGBTQ+ is.

Part of the report said: “In November, the social opinion polling agency SKDS and Mozaika’s poll found that 49% had a neutral stance towards ‘homosexual’ people, 25% were accepting, and 23% condemned ‘homosexuality’. A third of the respondents said they did not know an LGBT person.”

READ MORE: Ranking reveals the best and worst places to be LGBTQ+ in Europe

Rinkevics, who “proudly” came out as homosexual in 2014, previously rebuked suggestions that he has a “hidden agenda”.

“I do not believe that something fundamental should change in people’s attitude toward me or other people,” he explained during an interview several years ago. “It is time for us to be more open and honest. Believe me, such decisions are not easy to make and can take a long time.

“I contemplated all the positive and negative consequences that may arise due to my decision and decided that it is better to be honest and to speak frankly, as well as to urge a discussion about these matters, including registration of partnerships, which is a complicated topic.”