The first group of volunteers for a Ukrainian national guard did exercises this week, including this one on hand-to-hand combat. Anatolii Stepanov/AFP/Getty Images

NOVY PETROVTSY, Ukraine — The foxhole Vladimir Ibadolayev was digging in the sandy pine-forest soil was slightly more comfortable than the hard cobblestones he had slept on for weeks while helping to overthrow the Ukrainian government, but he wasn’t complaining. His neighbor in the foxhole next door, Ivan Yarchenko, threw a pack of cigarettes and kidded him for complaining, comparing it briefly to his time serving in the Soviet military.

The two, now wearing mismatched camouflage and ill-fitting helmets, forged their friendship on Maidan, the Kiev square that was the epicenter for the anti-government protests that descended into savage mayhem last month, ousting President Viktor Yanukovich — and bringing the specter of war with Russia. Now they’re trying to become Ukraine’s newest fighting force.

“I love my country. I don’t want to give up one bit of our territory,” Ibadolayev, 29, of Kiev, said.

“There will be war. That’s a fact,” Yarchenko, a 40-year-old construction engineer from Ivano-Frankivsk, said. “On Maidan, we didn’t think about what we were doing when we were fighting — we could be killed or not. We were just defending one another, our comrades. Same thing here. When we go to war, we’ll be ready.”

In the eyes of many Ukrainians, this nation of 45 million faces an existential crisis unprecedented in the 23 years since the Soviet collapse. Russian forces loom on the eastern border. Moscow has annexed Crimea and forced a humiliating withdrawal of Ukrainian troops from the Black Sea peninsula. In the cities of Kharkiv and Donetsk, pro-Russian activists are suspected of fomenting violence, to create a pretext for invasion. The three-week-old technocratic government in Kiev is struggling to stave off economic collapse.

Amid all this, Ukraine is experiencing a resurgence of pride and patriotism, a wellspring that began emerging for many in the Maidan protests. With Russia moving to formally seize Crimea, the interim government of Prime Minister Arseniy Yatsenyuk last week announced the creation of a new national guard, with the goal of recruiting 20,000 volunteers. The interim government also increased the military budget with an emergency allotment of about $680 million.

More than 4,000 people had signed up since the law authorizing the guard was passed March 13, acting Interior Minister Arsen Avakov said this week.

“You will have the opportunity to defend the country, with the forces of the national guard and the security forces," Yatsenyuk told a Cabinet meeting over the weekend.