KHAN YOUNIS, Gaza Strip—Beneath the rubble of a bombed-out residential neighborhood in Khan Younis lies a sprawling, subterranean complex built to shelter senior Hamas leaders and, for a time, used to hold Israeli hostages grabbed by the militant group, Israeli officers said.

An access shaft hidden in an unassuming family home leads to a sophisticated underground warren with several kitchens, fitted out with gas stoves and refrigerators, as well as sleeping quarters and bathrooms—one decorated with a mosaic of a tropical beachfront scene.

A metal-barred gate blocks the entrance to a chamber converted into a cell. Israeli investigators say forensic evidence, including DNA, indicates that at least 12 people kidnapped by the militants during their Oct. 7 assault on southern Israel were held in the cell or elsewhere in the complex.

Hamas, which is designated as a terrorist organization by the U.S., the European Union and others, has constructed a vast underground network of tunnels , barracks, armories and other facilities beneath Gaza’s densely populated cities to hide its fighters, weapons and hostages from the Israeli forces hunting them.

Israel’s military says there are hundreds of miles of tunnels in Gaza. Some, like the one where hostages were kept, appear meant to house militants for long periods. Others are used to transport goods and people, and some are specifically designed to facilitate hit-and-run attacks.

This underground world has bedeviled Israel’s efforts to destroy Hamas , whose fighters poured into Israel and killed 1,200 people, mostly civilians, on Oct. 7—the deadliest day in Israel’s history. Tunnel warfare is treacherous and slow going, Israeli officers say.

As fighting has raged on the surface—with Israeli airstrikes and clashes between Hamas fighters and Israeli infantry and armored units—more than 27,000 people in Gaza have been killed, according to Palestinian health authorities. That number doesn’t distinguish between combatants and civilians.

Meanwhile, for the four months since the war started, Hamas’s senior leaders have managed to evade capture, conceal hostages and protect their fighting forces, primarily by making use of their extensive, hidden underground complexes , Israel’s military says.

The Wall Street Journal explored a tunnel complex below Khan Younis this week in a trip arranged by the Israeli military. The route to the scene was lined by piles of concrete and steel and empty, blown-out carcasses of buildings. Some had Hebrew graffiti, including memorials to fallen Israeli soldiers, scrawled on them.

In the middle of a devastated residential neighborhood, inside the hefty cement foundations of a destroyed house, was a narrow-arch structure—the gateway to an underground compound. The entire block had to be laid to rubble to get to it, said Brig. Gen. Dan Goldfus, who commands Israel’s 98th Paratroopers Division and is leading Israel’s fight in Khan Younis. “My soldiers fought to take this ground,” he said, pointing to ruins all around him.

He said Hamas defended the area with RPG and rifle fire, and by storming tanks and trying to place explosives on their hulls.

There are tunnel shafts all around Khan Younis, Goldfus said. “There is a shaft in every place you can find,” he said. “In the schools, in the mosques, in the supermarkets. Wherever you go there is a shaft going down into the underground world.”

The subterranean web under the neighborhood, in places 15 to 25 yards below the surface, appeared to have been abandoned with relative haste. Dishes remained in the sinks, blankets and mattresses littered the floors. A pink trash basket was filled with discarded medical supplies, including antibiotics and an antifungal cream.

Passageways were dark, dank, narrow and just high enough to pass through in a crouching position. Walls were reinforced with concrete and electrical cables snaked along the tunnels. Steps smoothed the descent underground.

After twists and turns, the tunnel opened into a living complex with tiled floors, walls and ceilings. The vaulted chambers had ceilings roughly the height of an ordinary apartment. Rooms were equipped with electric fans to deal with the stifling heat and humidity of the burrowed complex.

Scattered throughout the complex were empty plastic water bottles. Some passageways were blocked by sandbags made using flour sacks marked with the name and logo of the U.N. Relief and Works Agency , which provides aid to Palestinian refugees.

Living compartments had protective metal doors at their entrances. Their installation, according to Daphné Richemond-Barak, a professor at Israel’s Reichman University and author of a book on underground combat, would be an impediment to Israeli attempts to use drones, robots or dogs to help clear the underground maze.

Richemond-Barak said Hamas’s decision to hold hostages underground has made it harder for Israel’s military to fight in the tunnels and destroy them. “Hostages fulfill a double function—as a bargaining chip and as human shields,” she said.

Military officials say their underground operations now are focused on applying pressure on Hamas to force it to accept terms more favorable to Israel in a deal to return the hostages .

“Our kidnapped civilians held here by Hamas, we will get them either in a direct manner, or an indirect manner,” said Goldfus. “We have to create the leverage for our leaders to bring back the kidnapped.”

Three of the hostages who the military says were held in the complex visited by the Journal, including a 16-year-old girl named Sahar Kalderon, were returned to Israel in November as part of a prisoner-exchange and cease-fire deal.

Sahar, her younger brother and their father, Ofer, were kidnapped from Kibbutz Nir Oz on Oct. 7.

Members of the Kalderon family didn’t respond to requests for comment.

Sahar told Israel’s Channel 12 there was little food in the tunnels she was kept in, she never saw daylight and her guards taunted her saying Netanyahu had abandoned them.

“I felt like I was forgotten,” she said.

Write to Dov Lieber at