GAZA CITY, Gaza Strip (AP) — The small town of Abassan in the Gaza Strip is a tough place to infiltrate: Everyone knows everyone and outsiders passing through quickly attract attention. So when strangers drove through town, suspicious Hamas security men stopped the van and questioned those inside.

The answers didn't add up.

With their covers about to be blown, the Israeli undercover forces in the vehicle opened fire, setting off a fierce battle that left eight people dead and triggered a brief but intense round of cross-border fighting.

A month after the exchange, the raid remains clouded in mystery. The Israeli army has kept mum, while Hamas officials have declined to comment publicly as they investigate. With each side protective of its secrets, and possibly keen to spread disinformation, the full story may never be known.

But based on interviews with Hamas officials, a picture is emerging of a carefully planned Israeli intelligence operation in which agents posing as Palestinian aid workers may have gone undetected for up to two weeks before it went awry. All spoke on condition of anonymity, citing a Hamas gag order.

In the meantime, Hamas has tightened security in Gaza, is questioning foreign visitors such as journalists and aid workers, and has sentenced six alleged collaborators to death.

"We take security measures after any security incident to ensure it doesn't happen again," said Iyad al-Bozum, spokesman for Hamas' Interior Ministry, which is leading the investigation.

Israel and Hamas are bitter enemies that have fought three wars since the Islamic militant group seized control of Gaza in 2007 from the rival Palestinian Authority. Israel and Egypt have blockaded Gaza by air, land and sea since the takeover.

Sending an undercover unit into Gaza would be complicated and risky. With Gaza fenced off, the border area is closely watched by Hamas. Only a handful of crossings operate. Parachuting in or bursting through the border would almost certainly be detected.

Hamas officials believe the Israeli team was disguised as aid workers and entered Gaza through the Israeli-controlled Erez crossing, a fortress-like facility through which all civilian traffic passes.

On the Gaza side of the crossing, the team passed through two checkpoints — one controlled by the Palestinian Authority and the second controlled by Hamas — using forged IDs with the names of well-known local Palestinian families. Hamas has released a number of images of people it says were squad members.

The Associated Press spoke to eight Hamas figures, including some security officials.

It remains unclear what the Israeli team did inside Gaza. One official said they posed as aid workers, pretending to move disabled people to hospitals in a van. The team had a wheelchair, along with a member disguised as a disabled woman. They visited many houses and even rented an apartment in Gaza City, he said.

There are differing accounts on how long the team operated, from several hours to two weeks. One official said it appeared to have been a reconnaissance mission to "breach the communications network of the resistance."

According to some of the accounts, the scheme began to unravel when the team made its way to Abassan. Suspicious residents alerted Hamas security, which stopped their van.

One official said the leader of the Israeli group, reportedly a member of Israel's Arab Druze minority, spoke the local dialect fluently and remained calm.

But several things did not appear right. He said a woman was sitting between two men, even though their IDs showed them to be members of different families. Under local customs, it is frowned upon for a woman to sit alongside men who are not her relatives.

"That was the major reason for the suspicions," he said. Under further questioning, the team told Hamas that they were going to visit a woman who does not live in the area.

Hamas security men asked them to wait while their commander, Nour Baraka, was summoned. According to various accounts, the situation deteriorated when Baraka arrived and began asking more questions. When Baraka ordered their detention for further questioning, the Israeli team opened fire and killed him. As the team fled, Hamas security men fired back, apparently killing the Israeli commander.

Hamas officials say the team was over two kilometers (over a mile) from the Israeli border, and Israeli military aircraft, including two helicopters and a warplane, carried out over 40 airstrikes to give the men cover to flee. An airstrike destroyed the Israeli van, apparently to get rid of incriminating evidence. Six more militants died in the fighting.

Mohammed Abu Daqqa, a resident of the area, said he was at home about 8:45 p.m. on Nov. 11 when he heard the sound of breaking glass outside.

He opened his window and saw a Palestinian gunman firing a pistol at a vehicle whose occupants were shooting weapons equipped with silencers. After the shooting subsided, he went outside, where he saw a gunman frantically shouting: "They shot Sheikh Nour." He said the body was lying on the ground.

Hamas and other militant groups retaliated with rocket and missile fire, leading to the heaviest fighting with Israel since a 2014 war. On the brink of war, the sides agreed to a cease-fire on Nov. 13.

Israeli undercover units have been operating in the Palestinian areas since the 1980s — and currently have gained renewed attention with the Netflix hit show "Fauda."

Samuel M. Katz, author of "The Ghost Warriors," a book about Israeli undercover units during the second Palestinian uprising, said he had no knowledge of this raid, but that it appears to have been an intelligence-gathering team, not a hit squad.

Katz said that if Israel wanted to assassinate a wanted militant, it has less risky alternatives like airstrikes. "One thing you can say at this point, it must have been a high-value target or a high-value mission," he said.

The Israeli military has said little about the raid and has refused to confirm foreign and Palestinian reports that the officer who was killed was Druze. But a military official, speaking on condition of anonymity under military protocol, said it was neither the first nor the last mission behind enemy lines.

"The IDF will continue to conduct special operations wherever necessary to ensure the safety of Israeli civilians," he said.