The military commander of this breakaway Armenian republic predicted in an interview here Monday that a fragile cease-fire could collapse within days. By that night, Azerbaijani shelling had killed two Armenian soldiers in a northern border town, amid accusations by each side that the other had violated the truce.

The “frozen conflict” here, stalemated for 22 years, exploded on April 2, when Azerbaijani forces attacked across the 200-kilometer front line. The Azerbaijanis seized ground for the first time since the previous war ended in 1994. Russia negotiated a quick truce that began April 5, but as Monday’s fighting showed, another all-out conflict seems perilously close.

Karabakh is one of the world’s least-discussed and most intractable quarrels. The mostly Armenian population violently seceded from Azerbaijan in a two-year war. Since then, Russia, France and the United States have sponsored a mediation effort, but it has been fruitless: Azerbaijan demands that land once inside its borders be returned; the Armenians insist they aren’t leaving. Rather than softening over time, anger seems to be hardening on both sides.

Russia is opportunistically in the middle. Moscow says it wants to broker a lasting peace deal, but it has also been arming both sides. The United States also hopes to prevent a wider conflict but has little diplomatic leverage. The Azerbaijanis, judging by their strident social media, feel emboldened by their recent offensive; the Armenians feel isolated and increasingly reconciled to what one former peace activist here described to me as a state of “permanent war.”

I visited Karabakh with several other foreign journalists and a member of the European Parliament on a trip organized by the Armenian government. The 90-minute helicopter flight took us over stunning mountainous terrain to this lush, isolated enclave whose name means “black garden.” During my brief visit, the place seemed a bit like Switzerland in the Caucasus — not just the mountains but also the tidy streets, hillside farms and fiercely independent people.

Lt. Gen. Levon Mnatsakanyan, the defense minister of this self-declared republic, said his forces hadn’t expected the broad attack on April 2. But he said there had been warning signs: Since August, 21 Armenian soldiers had been killed and 113 wounded in attacks along the so-called “line of control.” And Azerbaijan had been restocking its arsenal with new Russian tanks, Israeli drones and Turkish missiles. The Armenian side, reassured by a supposed “strategic alliance” with Russia, didn’t expect a big Azerbaijani offensive.

“Tactically, maybe they have registered some successes,” Mnatsakanyan conceded. “But I would say that considering all the force they used, it’s rather a defeat for them.” He claims the Azerbaijanis had lost 24 tanks in the four-day battle in early April. The two sides have radically different casualty counts, and it’s impossible to independently verify the numbers. But Azerbaijani commentary has treated the campaign as a major victory after the smoldering defeat of the 1992-1994 war.

Mnatsakanyan insisted that Armenian troops could defend the enclave, without Russian help: “The result of the four-day war shows that the equipment we have and our combat readiness is okay for stopping any adversaries.” If the war resumes, he says, “we will not only repel them but advance ourselves.”

Talking to Armenian residents of Karabakh, I came away with a sense of growing militancy here, as in Azerbaijan.

Garen Ohanjanyan, the former peace activist, says this latest war has changed his view about the possibility for reconciliation. After the last war ended, he helped foster dialogue with Azerbaijanis. Now, he says, he has given up on peace and wants Armenian forces to destroy Azerbaijani economic targets. In the past month, he explains, “our nation lost its illusions.”

“Maybe my generation became too relaxed in these past years,” says Ashot Sarkissyan, a 27-year-old who works with a local nongovernmental organization and also serves in an antiaircraft defense unit. “Why didn’t we use this time to become strong enough to deter them from a war?”

Anahit Danielyan, who heads the Stepanakert Press Club, says she used to try to stay in touch online with Azerbaijani journalists. Now, she says, “I’m starting to feel this hatred from my colleagues in Azerbaijan. . . . This new war has somehow changed our perceptions of each other.”

On the road to the airport, a visitor can see the national monument, a huge stone statue of an old man and woman — heads only, the bodies seemingly buried in the hillside. The official name is “We Are Our Mountains.” The implicit message is: We aren’t moving. What seems ahead is a long, unyielding conflict.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.