MOSCOW — Voters in Latvia on Saturday overwhelmingly rejected a proposal to adopt Russian as a second official language, defeating a constitutional referendum measure that underscored the ethnic and political tensions that remain more than 20 years after the collapse of the Soviet Union.

“The vote on a second state language endangered one of the most sacred foundations of the Constitution — the state language,” the Latvian president, Andris Berzins, said in a statement after the vote. “I would also like to thank everyone who, despite the emotions and impassioned atmosphere which were conjured up by the referendum, maintained a cool head and tolerance without yielding before provocations and attempts to foment hatred.”

Prime Minister Valdis Dombrovskis, who actively opposed the referendum, said he was grateful to Latvian voters for resoundingly rejecting it, but he said some conciliatory steps would be needed.

“What we need to think now is what additional measures could be done on integration and naturalization policies, including more opportunities to study Latvian,” Mr. Dombrovskis said in a telephone interview. He added, “It is clear that we need to look at what more we can do.”