Latvian soldiers salute during a military parade in Riga marking Latvia’s Independence Day on Nov. 18. (Valda Kalnina/European Pressphoto Agency)

Amid surging fears about what Donald Trump’s presidency will mean for nations lining Russia’s border, the employees of Latvia’s Defense Ministry have a worst-case plan: They will defend their imposing headquarters in central Riga to the last.

They formed a 20-person-strong unit of a volunteer militia over the summer. They are armed. And they have been training.

Baltic leaders, scarred by the Soviet takeover in 1940 that lasted for more than half a century, are worried that they could be cut out of any deal that Trump makes with Russian President Vladimir Putin. The president-elect repeatedly praised Putin on the campaign trail as a stronger leader than President Obama and has vowed to prioritize cooperation with the Kremlin on anti-terrorism efforts. Trump and Putin spoke on the phone Monday in a conversation that made no mention of Russia’s annexation of Crimea or support for rebels in eastern Ukraine, according to the Kremlin.

Here in Latvia, a nation of 2 million where the annual government budget is one-sixtieth what the United States spends on its military alone, security officials are responding to the U.S. push to bolster their military capabilities in big and small ways. That includes the scrappy effort to protect the Defense Ministry, a fallback plan that employees were preparing even before Trump’s victory.

“We will have weapons in the ministry and we will be ready to defend ourselves,” said Defense Ministry State Secretary Janis Garisons, a mild-mannered former diplomat who is the senior civil servant in the ministry — and who has been drilling with his colleagues since summertime.

Latvia, Lithuania and Estonia joined the North Atlantic Treaty Organization in 2004 and received commitments of thousands of allied troops just this summer. But they were spooked by Trump’s campaign-time view that NATO was “obsolete” and his vow that he would not automatically come to the aid of U.S. allies if they were attacked by Russia and instead would review “if they fulfill their obligations to us.”

Now Baltic leaders are waiting to see how Trump actually shapes his evolving relationship toward Putin and NATO. Mindful that Baltic states have little ability to shape U.S. policy, officials say that they will simply hold to current plans, which include bolstering defense spending above NATO guidelines. Many are skeptical that Trump’s dreams of detente with Russia will be successful. But Latvian officials also say they are ramping up planning for the last-ditch scenario if they need to fend off Russia on their own.

Though the countries would be vastly outmatched if the Kremlin invaded using its conventional forces, they say they have the will to mount a fierce insurgency. Latvia is expanding its part-time volunteer force, the National Guard, to 8,000 people, and in the wake of Trump’s election hopes to push the numbers higher. Estonia has enrolled more than 25,000 volunteers in its similar Defense League. Lithuania has published guides about what to do in case of Russian invasion.

“The dreams that Americans or God will save us, it’s somehow over,” said Artis Pabriks, a former Latvia defense minister who is now a lawmaker in the European Parliament. “We simply have to stick to the view that if something should happen, we will fight like the Finns in 1939, so the West will have to help us.”

Angst about Trump suffused Latvian Independence Day celebrations Friday, even making its way into the official benediction at the 13th-century Riga Cathedral as leaders and military officials prayed for Latvia’s continued freedom. The service ended with Latvia’s national anthem, which was a crime to sing during the half-century of Russian domination that ended in 1991.

“For the first time we’re worried about our future, our kids,” said Ivars Aboltins, 41, a civil engineer who brought his family to the banks of the Daugava River on Friday to watch a military parade marking the holiday. A handful of U.S., British and Canadian troops stationed in the country also took part.

“At home, we don’t talk about politics, but he can tell we’re worried,” Aboltins said of his 8-year-old son.

But amid the concerns, ­Latvians also take comfort that despite the country’s size, they believe it has pulled its weight in recent years. Latvian forces fought alongside U.S. soldiers in Afghanistan and Iraq, and seven soldiers were killed. 

“We are not going to panic,” said Latvian Foreign Minister Edgars Rinkevics. “We really don't see the end of the world as we know it.”

He noted that Obama and President George W. Bush also tried to reset relations with Putin before abandoning those efforts when the Kremlin proved more obstreperous than they expected.

Despite the concerns from national leaders, voices in Latvia’s ethnic Russian minority, which is about a third of the population, welcome the prospect of reconciliation between the United States and Russia.

“If we can get back to the relations we had in 2013,” before the Crimean annexation, “we’d welcome that,” said Nils Usakovs, the mayor of Riga and the leader of the Harmony Center party, which draws most of its support from Russian speakers. “It was very relaxed. There was trade, tourism.”

Over the summer, the United States, Britain, Canada and Germany committed to lead battalions of about a thousand troops each in Latvia, Poland, Lithuania and Estonia. Despite Trump’s questioning of NATO, the U.S. troops who will be deploying to Poland early next year have already begun the complex logistical arrangements to transit across the ocean. And it is unclear whether the new president would be willing to accept the international opprobrium that would come from backing down on the plans.

“People who go to Moscow and think we can offer peace in our time, they don’t understand that from every encounter like that, Putin takes something very substantial,” said Juri Luik, the head of the International Center for Defense and Security, based in Tallinn, Estonia. “If you are ready to give it to him, you have to be ready to look like a real loser, someone who rolls over and plays dead.”

Still, some leaders here say they fear the Trump administration may abandon long-term commitments to NATO or the U.S. advocacy of sanctions against Russia — and they say that if the United States backs out, European nations may be quick to follow. On a tour of Europe this week, Obama said that Trump was committed to NATO. But many U.S. allies would prefer to hear that from Trump.

­­Most officials here doubt that their security is immediately on the line. Trump’s apparent unpredictability may lead Putin to be cautious about making mischief inside NATO countries — and Trump even said before the election that under his command, the U.S. military would shoot down Russian jets if they showed disrespect by buzzing U.S. ships and planes. Unlike in Ukraine, which the Kremlin appears to covet because of its historical ties to Russia, Baltic officials say they feel they are targets only because attacking them would challenge NATO and the European Union as a whole.

“If President Trump could work a deal with President Putin that would reverse the annexation of Crimea, remove all Russian troops from Ukraine and remove the buildup of troops on the Baltic border, then we say more power to him,” said Ojars Kalnins, the chairman of the foreign-affairs committee in Latvia’s Parliament. “But if a good relationship is at the expense of the Ukrainian people or security on our borders, that does trouble us.”

Kalnins and other Baltic lawmakers are planning a trip to Washington in early December to meet with Republicans in Congress in a bid to appeal to their traditionally hawkish position on Russia.

It remains unclear how much influence the Republican establishment will have on Trump’s foreign policy. Trump awarded his most influential national security position to retired Lt. Gen. Michael Flynn, the former head of the Defense Intelligence Agency who astonished his former colleagues by traveling to Moscow last year and sitting next to Putin at a gala dinner sponsored by Russia Today, the state-owned Russian television network. Flynn has called for tighter ties with Putin to battle the Islamic State in Syria.

“It’s a present, current security threat for us. We do not need to be told that it is. We know it,” said Lolita Cigane, who is the head of the European-affairs committee in the Latvian parliament and said she is counting on Trump to hold to U.S. commitments. 

But her family has a fallback, she said: Her husband recently signed up for the National Guard.