Tanel Mazur, the teacher of the class in Narva, said that around a third of his students were of Russian descent, a third Estonian and a third from mixed families, but that they defied easy labels. All speak Estonian, which is used in class;English; and Russian, the dominant language in Narva.

Not all of his students cheered Mr. Trump, and several, including one with a Russian background, said they worried that he might encourage trouble by trying to appease Mr. Putin.

Asked what they wanted from Mr. Trump now that he had been elected leader of the free world, one student said he must “keep his emotions back.” Another said he “should make America great again,” while the class joker advised that Mr. Trump “change his hair” to be taken seriously.

Mr. Mazur, who teaches in Estonian and stayed up late on election night to follow the results, said he never liked Mrs. Clinton much but added that she at least “had a much clearer message” and you “knew what to expect, more or less.” Mr. Trump, by contrast, “has said so many different things, nobody knows what he really wants to do.”

Adding to the uncertainty and alarm are statements by some of Mr. Trump’s supporters, like Newt Gingrich, who described Estonia as “the suburbs of St. Petersburg” and not worth a confrontation with Russia that could risk nuclear war. Mr. Gingrich is now a long-shot candidate for secretary of state.

“The idea that our country is just a suburb of St. Petersburg is a nightmare for every Estonian,” said Eerik-Niiles Kross, a member of Estonia’s Parliament and the country’s former intelligence coordinator. Mr. Trump’s election, he added, “has sent a shiver through the whole region” because it reopened security questions that “were thought to have been closed with the expansion of NATO more than 10 years ago.”