MOSCOW — A pro-Russian party has gained the most votes in a snap parliamentary election in Latvia, with economic worries and anger over perceived government malfeasance trumping the anti-Russian sentiments that have kept such parties at bay since the small Baltic country gained independence from the Soviet Union 20 years ago.

Latvia’s Central Elections Commission announced Sunday that the pro-Russian party, Harmony Center, got more than 28 percent of the vote in Saturday’s elections, a significant improvement over previous contests.

Harmony Center’s opponents could still block its entry into the government by uniting in coalition, analysts said, and began talks on Sunday in an apparent effort to do so. Even so, the party’s rise to prominence is remarkable given Latvia’s history.

The Soviet Union absorbed Latvia, along with its neighbors Lithuania and Estonia, in 1940. After independence in 1991, Latvia sought to shield itself from Russia through integration with the West, joining the European Union and NATO.