STARYCHI, Ukraine — The mourning began with a pair of caskets, one open, one shut.

Lined in white fabric, they held two of the Ukrainian fighters killed in Russia’s invasion. Here, in a gray village under a gray sky near the western border with Poland, they were the first reminder that the war could come this far.

The men were killed Sunday when Russian missiles struck a military base in nearby Yavoriv, a hub of military cooperation between Ukraine and NATO countries. At least 35 people died in all.

Until then, this part of Ukraine had been spared, a witness only to the exhausting flow of hundreds of thousands of refugees heading for the border. Bright billboards urging war readiness had been raised. On lonely roads between winter’s barren fields of sunflowers and corn, villagers erected sandbagged checkpoints, bottles for Molotov cocktails stacked behind them.

Then the missiles came. On Wednesday, three days later, the villagers gathered in Starychi to bury Roman Rak and Mykola Mykytiuk. They were soldiers, men in their late 40s and early 50s.

Loved ones and fellow soldiers, many their age or older, with paunches and fraying hair, were the first to mourn. They entered a small room in the cold churchyard holding the caskets and made the sign of the cross. A soldier knelt.

Slowly, more villagers arrived. A teenage boy with close-cropped hair, not too far from military age, carried red roses. Men in flat caps gathered on a bend in the road and spoke among themselves. Women, some in headscarves, stood in silence.

The crowd grew to scores of people. At a signal, fellow fighters carried the caskets across the yard and into the wooden church, and a loudspeaker crackled. The service began. The crowd gathered, standing outside the door.

“These guys were like angels for us,” said a local deacon, Taras Hlova. “They died protecting us.” Even he, living seven kilometers from Sunday’s attack, was woken up by it. He saw the glow in the sky. His wife, a nurse, spent the next full day treating the wounded. “I thought they’d be crazy to attack so close to NATO countries,” he said of Russia. “I hope God has mercy on us.”

Even a priest at Wednesday’s funeral wore military uniform.

The main priest spoke about the war. He recalled the village’s ancestors who lived here beginning more than a millennium ago, the people of Kievan Rus, considered the first Slavic state. They were fighters, he said, and they were brave enough to look in the face of their enemy.

The war we have now is a cruel one, with nothing fair in it, the priest said, the dead soldiers before him. But we won’t let anyone seize our lands. God is with us because we are at home.

These are heroes, he said. Our heroes. Ukraine’s heroes. The people’s heroes. And he echoed a phrase that is now constantly repeated at funerals across Ukraine: Heroes never die.

The caskets were draped with flags. Fighters carried them out. The church bell began to ring. And the villagers, hundreds now, walked the two men to their graves.

Past the empty metal playground. Past the brick homes with lace curtains. Past an old woman standing in her yard, crying, her hands together in prayer. Past a line of residents kneeling along the sidewalk near the shops.

A brass band led the way, the caskets in a drab green military vehicle behind it.

The procession stopped at an empty corner of the graveyard. There was the flash of a golden cross, the thud of dirt, the national anthem. Hands on hearts, the murmur of song. A line of soldiers with rifles fired in salute. More prayer.

And then the digging began in earnest. The crowd left the mounds of earth carefully placed with the men’s photos, flowers, candles. The family were the last to leave.

There would be no questions. The son of one of the dead men waved away a request.

It was not a good time for him. It would not be for a while. The son was a fighter, too.