With a population of only two million, Latvia has always had one nervous eye on its vast neighbour to the east, but events in Ukraine this year have set alarm bells ringing for the country's politicians and increased suspicions about Latvia's large ethnic Russian minority.

The country went to the polls on Saturday in parliamentary elections where the issue of Russia and Russians has dominated the campaigning. With the Kremlin's policiy of "defending Russians abroad" leading to the annexation of Crimea and bloodshed in east Ukraine, and tough rhetoric coming out of Moscow over the rights of ethnic Russians in the Baltic states, national security has been more discussed than at any time since Latvia won independence with the collapse of the Soviet Union.

Up against the ruling coalition of centre-right parties was the Harmony party, led by the mayor of Riga, Nil Ushakov. Ushakov is a new generation of Latvian politician – young, charismatic and eloquent. He is also an ethnic Russian and the majority of his voter base comes from Latvia's Russian community. His party could well end up with the most seats in Latvia's 100-seat parliament, but other parties will almost certainly create a coalition to form a government and keep him out, as is the case with the current parliament, headed by technocrat Laimdota Straujuma.

Exit polls on Saturday night showed the three-party coalition government with around 60% of the vote. One poll gave the combined Unity party, Nationalist Alliance and Union of Greens and Farmers 62% of the vote for a likely 63 of parliament's 100 seats. The coalition currently has 57 seats. Harmony and For Latvia from the Heart, a left-leaning group supported mainly by the country's Russian-speaking minority, had 27% combined.

It has been a dirty election campaign of smears and accusations, with the biggest scandal coming in the form of a video unearthed in the weeks before the election in which the prime minister's press secretary took part in casting sessions for a pornography shoot.

But the biggest issue has been Russia and the fear among many Latvians is that, if Ushakov's party ever formed a government, it could lead to increased influence for the Kremlin. Ushakov's party is linked with Vladimir Putin's United Russia, and when asked on a Russian television station last month about his attitude to Putin he raised eyebrows by saying that the Russian president was "the best thing for Latvia right now".

"This is the first election where security and foreign policy have been the main issue," said Ojars Kalnins, chairman of the parliament's foreign affairs committee. "Ushakov is intelligent, he speaks Latvian. He was the big hope for Russian politics to cross the line and win Latvian voters, but his refusal to condemn the Crimea annexation and his support for the language referendum [on making Russian a second state language] has alienated a lot of Latvians."

Viktor Gushchin, an ethnic Russian historian and rights activist, claims any election in which 10% of the population has no right to vote cannot be democratic and calls Latvia a "xenophobic and Russophobic state built on Nazi principles", similar rhetoric to that which the Kremlin has used in east Ukraine.

Many ethnic Russians in Latvia are still "non-citizens" – they have a travel document but not a full passport and are not entitled to vote. Because the Latvian government considers the Soviet period an occupation, anyone whose ancestors were not living in the country prior to 1940 – the vast majority of Russians – has to pass an exam on Latvian culture and history before becoming a citizen. There are 282,000 non-citizens in Latvia, more than one in 10 of the population.

For the first time, money has been allocated for proper segments of Russian-language broadcasting on state channels. Oleg Ignatiev, a local ethnic Russian journalist, hosted a pre-election debate between main party leaders last week, and all except the radical nationalists had to speak Russian.

"Most Russians in Latvia are more European, they like Latvia, and they want to live here, but they are seen as a fifth column by the government," said Ignatiev. "At least thanks to Vladimir Putin's actions in Ukraine, suddenly our Russians are being included in the process, being asked for their votes."

Many Latvian politicians dismiss these issues and say there are no major ethnic problems in the country. "In my view there is no real problem in society; the problem is extremist politicians on both sides," said Kalnins.

Nobody, whether ethnic Russian or Latvian, is seriously suggesting that a Russian invasion of the Baltic states could come any time soon. For a start Latvia, unlike Ukraine, is a Nato member. But there are fears that the Kremlin's particularly hard version of soft power could be used to destabilising effect.

"Their real strategy is not to militarily occupy the Baltic states, that would create a problem for them for a long time," says Kalnins. "But what they would love is at least one of the Baltic states with a government that they can control, that would give them influence in the EU and Nato."

"Putin hates the Baltics, he wants to recreate the Soviet Union, and it's very important we never let Russian politicians into power who would sell our country to the Kremlin and kill our independence," said a 32-year-old ethnic Latvian lawyer who was voting in the capital. Many ethnic Russians said they would vote for Ushakov simply because there was no other choice.

"We've allowed ourselves to fall into a situation where people more or less do vote along ethnic lines," said one Latvian government source who is frustrated at the lack of integration over the past two decades. "There should be more of an attempt to bring Ushakov and his people into government. It's better to do it with reasonable people like him than to leave the ethnic Russian population to the lunatics who really are backed by the Kremlin."