GOTLAND, Sweden — Late last year, Christer Stoltz, chief of contingency planning for Gotland, Sweden’s largest island, got an unusual letter from the central government in Stockholm, telling him to get ready for war.

Municipalities around the country should “increase their ability to resist an armed attack against Sweden from a qualified opponent,” the letter from the Swedish Civil Contingencies Agency said.

The planning was also intended to respond to natural disasters, oil spills or cyberattacks that could disrupt power and water supplies. But there is no doubt that the Swedish authorities are nervous, given Russia’s more assertive posture and the mounting uncertainties about the future of Europe’s alliance with the United States.

On Thursday, the government announced that mandatory military service — abolished in 2010 — would be introduced starting next year. Four thousand men and women will be drafted into the defense forces.