In the EU vote, supporters led nay-sayers by 67% to 32.3% with turnout at 72.5%.
Many of Latvia's pro-Brussels voters hailed EU membership as the crowning achievement of the ex-Soviet satellite's "return to Europe" after more than a decade of painful reforms since independence from the Soviet Union in 1991.
"For Latvia this is putting the final full stop to the sequels of the Second World War, and wiping out forever the divisions on the map of Europe that the odious Molotov-Ribbentrop pact … placed there," said President Vaira Vike-Freiberga as she voted in the small Baltic nation of 2.3 million.
Under secret protocols of a non-aggression pact signed in 1939 by the Soviet and Nazi German foreign ministers Vyacheslav Molotov and Joachim von Ribbentrop, the then-independent Latvian state fell under Soviet control while Poland was partitioned.
But the victory may be cold comfort for Prime Minister Einars Repse whose rightwing coalition now appears in danger of collapse. Latvia's EU future assured, junior coalition partners may now mount a challenge to Repse as early as this week.
Analysts said Repse, accused by rivals of authoritarian leadership, can draw on support in his own New Era Party. But extended political wrangling could raise uncertainty within the EU and NATO over preparations to join those groupings next year.
Latvia's move to join brings EU
membership to 25 countries
Latvia's weekend vote marks a success for the EU enlargement from 15 to 25 member countries and gives Brussels something to celebrate after Sweden rejected the euro last weekend.
"We welcome a country that naturally belongs to us and we trust that Latvia as the other future member states will enrich and strengthen the European Union. Welcome home, Latvia!" said European Enlargement Commissioner Guenter Verheugen.
Malta, Slovenia, Hungary, Lithuania, Slovakia, Poland, the Czech Republic and Estonia have already voted to join the EU. The 10th nation to join, Cyprus, is not holding a referendum.
Supporters believe joining the EU will secure freedom, democracy and growth in the poorest of the accession countries.
But some Latvians distrust the European Union just as they did the Soviet Union, and regard Brussels as too remote to care for their interests in an enlarged union from May 2004.
People in a Russian area of Riga.
One fifth of Latvians are Russians
Many in the large Russian minority of close to one-third of the population, most of whom were not allowed to vote, worry that EU entry will distance them from Russia.
Latvia has thrown open the possibility for the 644,000-odd ethnic Russians who came to live during the Soviet years to seek citizenship.
But most have yet to apply and will need visas to work and travel in the EU. Together with Estonia they will bring about one million ethnic Russians into the union.