TEL AVIV, OCTOBER 9

For Palestinians in Gaza, Israel's eyes are never very far away. Surveillance drones buzz constantly from the skies. The highly-secured border is awash with security cameras and soldiers on guard. Intelligence agencies work sources and cyber capabilities to draw out a bevy of information.

But Israel's eyes appeared to have been closed in the lead-up to an unprecedented onslaught by the militant Hamas group, which broke down Israeli border barriers and sent hundreds of militants into Israel to carry out a brazen attack that has killed hundreds and pushed the region toward conflict.

Israel's intelligence agencies have gained an aura of invincibility over the decades because of a string of achievements. Israel has foiled plots seeded in the West Bank, allegedly hunted down Hamas operatives in Dubai and has been accused of killing Iranian nuclear scientists in the heart of Iran. Even when their efforts have stumbled, agencies like the Mossad, Shin Bet and military intelligence have maintained their mystique.

But the weekend's assault, which caught Israel off guard on a major Jewish holiday, plunges that reputation into doubt and raises questions about the country's readiness in the face of a weaker but determined foe. Over 48 hours later, Hamas militants continued to battle Israeli forces inside Israeli territory, and dozens of Israelis were in Hamas captivity in Gaza.

"This is a major failure," said Yaakov Amidror, a former national security adviser to Prime Minister Benjamin Netanyahu. "This operation actually proves that the (intelligence) abilities in Gaza were no good."

Amidror declined to offer an explanation for the failure, saying lessons must be learned when the dust settles.

Rear Adm. Daniel Hagari, the chief military spokesman, acknowledged the army owes the public an explanation. But he said now is not the time. "First, we fight, then we investigate," he said.

Some say it is too early to pin the blame solely on an intelligence fault. They point to a wave of low-level violence in the West Bank that shifted some military resources there and the political chaos roiling Israel over steps by Netanyahu's far-right government to overhaul the judiciary. The controversial plan has threatened the cohesion of the country's powerful military.

But the apparent lack of prior knowledge of Hamas' plot will likely be seen as a prime culprit in the chain of events that led to the deadliest attack against Israelis in decades.

Israel withdrew troops and settlers from the Gaza Strip in 2005, stripping it of a close handle on the happenings in the territory. But even after Hamas overran Gaza in 2007, Israel appeared to maintain its edge, using technological and human intelligence.

It claimed to know the precise locations of Hamas leadership and appeared to prove it through the assassinations of militant leaders in surgical strikes, sometimes while they slept in their bedrooms. Israel has known where to strike underground tunnels used by Hamas to ferry around fighters and arms, destroying miles (kilometers) of the concealed passageways.

Despite those abilities, Hamas was able to keep its plan under wraps. The ferocious attack, which likely took months of planning and meticulous training and involved coordination among multiple militant groups, appeared to have gone under Israel's intelligence radar.

Amir Avivi, a retired Israeli general, said that without a foothold inside Gaza, Israel's security services have come to rely increasingly on technological means to gain intelligence. He said militants in Gaza have found ways to evade that technological intelligence gathering, giving Israel an incomplete picture of their intentions.

"The other side learned to deal with our technological dominance and they stopped using technology that could expose it," said Avivi, who served as a conduit for intelligence materials under a former military chief of staff. Avivi is president and founder of Israel Defense and Security Forum, a hawkish group of former military commanders.

"They've gone back to the Stone Age," he said, explaining that militants weren't using phones or computers and were conducting their sensitive business in rooms specially guarded from technological espionage or going underground.

But Avivi said the failure extends beyond just intelligence gathering and Israel's security services failed to put together an accurate picture from the intelligence they were receiving, based on what he said was a misconception surrounding Hamas' intentions.

Israel's security establishment has in recent years increasingly seen Hamas as an actor interested in governing, seeking to develop Gaza's economy and improving the standard of living of Gaza's 2.3 million people. Avivi and others say the truth is that Hamas, which calls for Israel's destruction, still sees that aim as its priority.

Israel in recent years has allowed up to 18,000 Palestinian laborers from Gaza to work in Israel, where they can earn a salary about 10 times higher than in the impoverished coastal enclave. The security establishment saw that carrot as a way to maintain relative calm.

"In practice, hundreds if not thousands of Hamas men were preparing for a surprise attack for months, without that having leaked," wrote Amos Harel, a defense commentator, in the daily Haaretz. "The results are catastrophic."

Allies who share intelligence with Israel said security agencies were misreading reality.

An Egyptian intelligence official said Egypt, which often serves as a mediator between Israel and Hamas, had spoken repeatedly with the Israelis about "something big," without elaborating.

He said Israeli officials were focused on the West Bank and played down the threat from Gaza. Netanyahu's government is made up of supporters of Jewish West Bank settlers who have demanded a security crackdown in the face of a rising tide of violence there over the last 18 months.

"We have warned them an explosion of the situation is coming, and very soon, and it would be big. But they underestimated such warnings," said the official, who spoke on condition of anonymity because he wasn't authorized to discuss the content of sensitive intelligence discussions with the media.

Israel has also been preoccupied and torn apart by Netanyahu's judicial overhaul plan. Netanyahu had received repeated warnings by his defense chiefs, as well as several former leaders of the country's intelligence agencies, that the divisive plan was chipping away at the cohesion of the country's security services.

Martin Indyk, who served as a special envoy for Israeli-Palestinian negotiations during the Obama administration, said internal divisions over the legal changes was an aggravating factor that contributed to the Israelis being caught off guard.

"That roiled the IDF in a way that was, I think, we discovered was a huge distraction," he said.