Israel's early failure to detect the vast Hamas tunnel network that its forces destroyed in Gaza is triggering a wave of recriminations within the country's security and political establishment.

As Israel and the Palestinians agreed to a fresh cease-fire in Gaza that started at midnight there, efforts already were under way in Israel to address the latest challenge to the country's security. Just as Israel built a separation wall to stem a wave of suicide bombings and developed the Iron Dome air-defense system to blunt rocket attacks, it is already casting for deterrents to address the newest Palestinian threat.

Questions over why the tunnel threat was underestimated, and why investment in technology that could detect more of the passages was neglected, are becoming hotly debated in Israel. So is the question of how Hamas was able to obtain the thousands of tons of cement and other materials to build the tunnels.

Meir Sheetrit, a former member of parliament's foreign affairs and defense committee, said there was a troubling lack of knowledge about the tunnel building. "I don't think our intelligence knew how many tunnels were dug, the location of the tunnels or how many of them were planned for assault," Mr. Sheetrit said.

"We don't have the technology to detect the tunnels from afar currently. That means we have to rely on information coming from somebody who knows where the tunnel actually is," he added. "Of course, it's not easy for Israel to get human intelligence in Gaza."

Lt. Col. Peter Lerner, an Israeli army spokesman, rebuffed suggestions of any intelligence lapse, saying the military has known about Hamas's "strategic project" to build tunnels for years.

"We knew the vastness of the project, and we knew the specific points on the ground to a great extent," he said.

The underground network was painstakingly constructed by throngs of Palestinian workers, who used sophisticated machinery and thousands of tons of cement in a massive multiyear underground construction project into Israeli territory, according to current and former Israeli and U.S. officials.

Just as remarkable, according to those officials, were the lengths to which Hamas, the Islamist movement that rules Gaza, successfully kept for so long key details about the labyrinthine system secret from Israeli intelligence, which rely heavily on technologies capable of eavesdropping on all telecommunications in the Palestinian territories.

While the military said it managed to destroy 32 tunnels during ground operations that started July 17, Israeli officials acknowledged that many more tunnels likely remain.

Inside the tunnels, the military said it found rocket-propelled grenades, mortars, AK-47 assault rifles and motorcycles—evidence that they said showed they were intended as a way to kidnap and kill Israelis.

While the scope and sophistication of the concrete-reinforced tunnel network took the military by surprise, Israeli officials said what matters is that it was discovered and destroyed, dealing a major setback to Hamas, which invested between $1 million and $10 million for the construction of each tunnel.

The military estimates it cost Hamas $90 million to build the 32 tunnels that were uncovered.

The average tunnel requires 350 truckloads of construction supplies—enough to build 86 homes, seven mosques, six schools or 19 medical clinics, the Israeli military says.

Most of the cement and other materials used for tunnel construction was smuggled into Gaza through existing underground passageways from Egypt used to bring goods into the territory, said Guy Inbar, a spokesman for the Israeli military's department that oversees humanitarian aid to both Palestinian territories, Gaza and the West Bank.

Some tunnel-building materials also came from aid earmarked for development projects by international aid agencies in Gaza or were purchased on the open market when Israel allowed some imports into Gaza starting in 2010, Mr. Inbar said.

"Everybody is coming up with ideas how to improve this monitoring, and I hope we can do that," a senior Israeli official said. "It's not that we don't want these materials to come in, but the way it does has to satisfy our security needs. There has to be a very robust monitoring system, or else it's not going to work. Hamas shouldn't be able to rebuild its tunnel system."

Israel's discovery of a tunnel last year led to a tighter monitoring of construction materials passing legally through the Israeli-controlled Kerem Shalom crossing. New regulations required aid agencies to track shipments of cement and metal and monitor their end use.

One tunnel found by the Israeli military two months before the latest war with Hamas had a 165-foot-deep entry shaft and stretched about 2 miles underground before emerging above the ground at the Ein HaShlosha kibbutz in Israel.

Its arched concrete roof is about five feet high. Telephone and electric wires, along with rails for ferrying goods, run its length.

So significant was the discovery of the tunnel network, U.S. and Israeli officials said, that Israel's stated war aims shifted from stopping Palestinian rocket fire to plugging and destroying the underground passages, which posed an imminent threat to Israeli bases and communities all along the country's border with Gaza.

Tunnels have been used as smuggling routes from Egypt since the 1980s. Palestinian fighters started using them to carry out attacks on Israel in the early 2000s. In 2006, one was used to capture Israeli soldier Gilad Shalit, who was released five years later in exchange for more than 1,000 Palestinian and Arab prisoners.

The seizure of Mr. Shalit underscored the threat posed by the tunnels, and in a 2007 report Israel's State Comptroller sharply criticized the government's failure to address the peril. But according to former army officers, the Shalit ordeal was widely viewed in the military establishment as an isolated incident, not the harbinger of a broader trend.

When Hamas came to power in Gaza in 2007, the Islamist group set aside tunnel building and focused its military funds on rockets, according to analysts and former military officials.

Tunnel building was revived a few years later, however, by Israel's development of the Iron Dome air-defense, which largely neutralized the threat of Hamas's rockets, said Eado Hecht, a defense analyst who teaches at Bar-Ilan University in Israel.

Hamas's tunnel-diggers soon were perfecting their craft, said Mr. Hecht.

"At first they used spades, but gradually they developed a contraption using bicycle pedals to turn a digging machine," he explained. "It's not noisy like a petrol motor, but it's slightly faster than digging by hand. They also learned how to shore up and use concrete to strengthen the walls and roof."

Mushir Al Masri, a senior Hamas leader, declined in an interview last week to discuss details about the tunnels but he recently said tens of thousands of supporters were deployed to build them. He said the Israeli and Egyptian economic blockade of Gaza had forced the group to be creative in coming up with ways to defend the territory.

Doron Peskin, the head of research at Tel Aviv's Info-Prod Research, estimated the tunnel-diggers were able to progress 20 meters (65 feet) a day.

The undertaking wasn't cheap, said Mr. Peskin, who put the cost of building the tunnels at about $200 per meter.

Israeli spy agencies rely on information collection methods ranging from informants to technologies capable of sweeping up cellular and electronic communications in the Palestinian territories. Hamas countered that capability by wiring its longer tunnels with communications cables that weren't connected to the local telephone grid, the officials said.

Israel could figure out the origin of some of the tunnels because diggers' cellphone signals would abruptly disappear when they went underground and then reconnect to the network hours later when they emerged, but that didn't indicate where the tunnels led, officials said.

Hamas tunnel builders were aided in maintaining secrecy by layers of densely packed sediment between 30 and 60 feet below Gaza's surface, which geologists say was ideal for tunnel construction—not too rocky to dig through but not too loose to collapse.

This soil composition also made it difficult for Israel's ground-penetrating radar to locate the tunnels, current and former U.S. officials said.

The tunnels were also built with multiple exits, a senior Israeli military officer said, meaning that discovering and destroying one opening didn't mean that the whole passageway was put out of use.

Some senior American officials and experts say Hamas's ability to burrow so many tunnels into Israeli territory amounted to an intelligence and strategic-planning lapse for Israel and a coup for Hamas.

A senior Israeli official said the country's intelligence agencies had collected a great deal of information about the tunnels but acknowledged: "We didn't know everything."

Attempts to address the tunnel threat date from 1990, when the Israeli military and its procurement agency asked the Geophysical Institute of Israel to make recommendations for tunnel detection.

Two Israeli geologists approached the Defense Ministry in the early 2000s with a proposal to dig a moat around the Gaza Strip to stop tunnel building. The ministry spent $300,000 and several years studying the idea but never commissioned it.

Yossi Langotski, the deputy director of the Israeli Geology Institute, urged investment in subterranean detection technology for more than a decade.

His efforts to promote tunnel deterrence failed because the issue wasn't deemed a priority, Mr. Langotski said, calling the lack of adequate detection systems "a scandal."

A senior Israeli official said Israel's vulnerability to tunnels was discussed at high-level meetings in the months leading up to the war with an eye toward improving defenses but said: "There is no subterranean Iron Dome. People are already working on that."

A race is now on among Israeli entrepreneurs and government agencies to come up with a system to detect and prevent future tunnel incursions.

Magna DSP, an Israeli firm that specializes in infrared intrusion-detection systems already in use at the country's borders and airport, recently proposed its technology for use against the tunnels and plans to conduct a test of the system within the next two weeks.

Sensors would be installed in 20-meter-deep trenches at one-kilometer intervals along the Gaza border. Technologies using seismic waves or audio signals could eventually be installed to supplement it, said lead scientist Levy Zruya.

Other systems are under evaluation at Talpiot, a Ministry of Defense engineering unit, and at private companies. One that uses a grid of underground seismic sensors is in development by Israel's Elbit Systems and Rafael Advanced Defense Systems, which helped concoct the Iron Dome.