Latvia's parliament on Wednesday elected Defence Minister Raimonds Vejonis as the Baltic state's new president, giving the 28th member of the European Union a Green party head of state, AFP reports.

"I would like to improve relations with Russia... but while Russian rockets and heavy weapons remain in Ukraine, that's not really possible," the 48-year-old Vejonis said after winning the secret ballot in which 55 out of 100 legislators backed him.

He will replace centrist Andris Berzins, who took office in 2011. His victory comes at a time when the small Baltic NATO and eurozone member of two million people weighs security concerns amid heightened tensions with Soviet-era master Russia.

The Latvian president is commander in chief of the armed forces, nominates the prime minister and has the right to propose and return legislation to parliament.

Centrist Prime Minister Laimdota Straujuma told AFP she was "very pleased" of the outcome. "It certainly won't weaken the government," she said.

The vagaries of the indirect poll and its secret ballot have prompted thus far fruitless calls for reforms -- including allowing voters to choose their head of state directly.

A survey by the SKDS pollster released Wednesday showed 70 percent of respondents want to vote directly for their president.

Four candidates were in the race, including Egils Levits -- a judge at the European Court of Justice nominated by the right-wing National Alliance -- and former basketball star and banker Martins Bondars of the small, business-friendly Regional Alliance party.

Having shed Soviet rule in 1991, Riga has made national security a priority since Russia's annexation of the Crimean peninsula from Ukraine last year.

'Pagan'

Vejonis is a biologist and longtime Green party politician who also served as Latvia's environment minister before taking over the defence portfolio.

"My priority without any doubt will be national security, the strengthening of our armed forces and our borders," he told reporters on Wednesday.

"We've already agreed to spend two percent of GDP on defence by 2018, but we need to ask what else we can do to enhance national security."

Russia's increased military presence in the Baltic Sea and regional airspace since its annexation of Crimea from Ukraine last year has jangled nerves in the area.

NATO has been guarding the skies over Latvia and its small Baltic neighbours Estonia and Lithuania since 2004, when they joined the defence alliance but lacked the air power to monitor their own airspace.

Last month, the Baltic trio formally asked NATO to permanently deploy several thousand troops in their region as a deterrent to Russia.

NATO has not yet replied to the request but has mounted a series of military drills in the region bringing in thousands of troops from more that a dozen of its member states.

Vejonis also vowed to use his presidency to advance Green party environmental policies.

"As president I'll have the chance to discuss Green ideas widely... and to ensure that Latvia really is a green country."

As well as his native Latvian, Vejonis speaks fluent Russian and English. He is married with two children and lists his religious views as "pagan" on his Facebook page.