MARIUPOL, Ukraine - The Mariupol port at night on February 20, 2015. Mariupol is the only port city between the Russian border and Crimea on the Sea of Azov. (Karoun Demirjian/The Washington Post)

During the month-long battle between Ukrainian troops and pro-Russian separatists for the city of Debaltseve, the streets of Mariupol — about 120 miles away — were comparatively calm.

But the surrender this week of the strategic rail hub to rebel forces­ has panicked residents of eastern Ukraine’s only port city, raising fears that their home will be the rebels’ next target.

In fact, Mariupol has been preparing for a separatist invasion for months. There are roadblocks and checkpoints at every road into the city. The bridges leading from the east to the west are wired with explosives, ready to be blown up at the first sign of a pro-Russian advance. And officials are testing sirens in various districts of the city to warn residents of an air attack.

Although the active front line remains in the suburb of Shyrokyne, less than 10 miles from the city limits, residents are not sure their defenses­ will hold in the face of a concerted rebel attack.

“Of course, we don’t believe the soldiers can protect us. From Grads? No soldier can protect you” from Grad rockets, said Ira Chupina, who works at a market in the eastern part of the city, where the shelling over Shyrokyne can be heard around the clock. “We hope that the government won’t give us up. But we saw what happened at Debaltseve.”

One month ago, the market where Chupina works was the scene of shelling that left 30 people dead and more than 100 injured. The experience rattled city residents. Since that day, the market has emptied of sellers, and only 20 or 30 percent of shop owners remain. And many eastern district residents have moved toward the center of the city, where the sound of shelling isn’t as loud.

After Debaltseve, some are wondering whether they should move farther away.

“I stayed because starting life again is very hard,” said Viktoria Ligareva, 53, who has been selling pickled vegetables at the market for 15 years. “But if it’s going to be a complete collapse — oy. Like Debaltseve, or Vuhlehirsk? Then I’ll leave – but only then.”

City officials are trying to quell the panic by alternately denying the threat and offering residents assurances that the local combined military forces­ will prevent Mariupol from becoming the next Debaltseve — burned by war and now in rebel territory.

“Right now, we are building a strong defense line around the city. And it would help to build another defense line,” Mariupol Mayor Yuriy Khotlubei said in an interview. “It won’t be that easy for them to get into the city.”

That confidence is belied by the concerns of civilians and other officials working closer to the ground.

Petro Guk, the commander of the Azov battalion’s reinforcement operations in Mariupol, said in an interview that the battalion is “getting ready for” street-to-street combat in the city.

The Azov battalion, now a regiment in the Ukrainian army, is known as one of the fiercest fighting forces­ in the pro-Kiev operation. But since Sunday, it has pulled away from the front lines on a scheduled rest-and-retraining rotation, Guk said, leaving the Ukrainian army — a less capable force, in his opinion — in its place.

His advice to residents of Mariupol is to get ready for the worst.

“If it is your home, you should be ready to fight for it, and accept that if the fight is for your home, you must defend it,” he said, when asked whether residents should prepare to leave.

Some are ready to heed that call, as a matter of patriotic duty.

“I will stay and fight, if the war comes to my city,” said Anatoly Bezruchko, 62, who is retired but leads a local order of Cossacks. “You can’t just live to eat and sleep; you have to defend your homeland.”

But others might not leap to take up arms in defense of Kiev so quickly — and some might even welcome the invasion.

Despite the intensely pro-Kiev position of localgoverning officials, the community in Mariupol is split between sympathies for Ukraine and the pro-Russian rebels.

“To tell the truth, it’s 50-50 here,” said Konstantin Batozsky, an adviser to the former regional governor of Donetsk, who tried in the past to broker agreements to keep the war from getting to Mariupol. But those diplomatic channels have since closed, Batozsky said.

“The West doesn’t understand that things went too far,” he said. “Now it’s just a question of, will the West support Ukraine against Russia?”

Western officials started to grapple somewhat with that question Friday, as European Council President Donald Tusk noted that “further diplomatic efforts will be fruitless unless credibly backed up by further action.”

He added that Europe would soon start discussing “next steps” against Russia and the rebels.

But to date, such steps have been limited to economic and diplomatic sanctions — when what Kiev keeps asking for is guns. The Obama administration has said repeatedly that no decision has been made on sending lethal aid to Ukraine.

In the meantime, locals are blaming officials closer to home.

On Friday, the mayor and military officials in Mariupol held an open forum to answer questions. The mood was tense, and the tension peaked when one member of the national guard whom the mayor addressed as Yaroslav asked why people should believe that Mariupol would be protected from pro-Russian rebels when they had been told the same about Debaltseve, Donetsk, Luhansk and Crimea — and lost them all. Especially if officials in Kiev are still regularly accusing Russia of sending tanks across the border in the direction of Mariupol, charges that Moscow denies.

“If we’re going to deny all of that,” Yaroslav said, “we’re going to be left without Mariupol.”