GAZA, Gaza Strip --The 48-year-old Palestinian woman's husband was shot to death in 2012 by militants in the Gaza Strip for spying for Israel. A mother of seven, she herself was jailed by Gaza's Hamas rulers for aiding and abetting a spy -- her husband.

The widow's account to The Associated Press gave a rare look into the secret espionage side of the war between Israel and the Hamas militant group.

According to her, Israeli security agents took advantage of her late husband's financial troubles a decade ago, luring him into collaborating by offering him a permit to work in Israel. She was later recruited when she was allowed to take one of their children to Israel for medical treatment.

"Our life was hell. We were scared," she said of their years feeding Israel information. "I used to look over my shoulder when I am out in the market, get scared when I see a police car." The woman, who was released in December, spoke on condition of anonymity because Hamas does not allow freed collaborators to talk to the press.

Israel has historically relied on collaborators against Palestinian militants and activists, recruiting them with methods ranging from entrapment and blackmail to cash and perks. Hamas, in turn, has done whatever it can to stop collaborators -- particularly by killing them in public as a deterrent to others -- since it holds them responsible for helping Israel assassinate dozens of its top figures.

The issue emerged again with the latest round of fighting in Gaza, which ended late last month. During the war, militants gunned down 22 suspected spies, almost all of them on a single day after three senior Hamas military operatives were killed in an Israeli airstrike apparently guided by collaborators.

Palestinians human rights groups sharply criticized Hamas for carrying out extra-judicial killings.

"It was a terrifying message to society and a deterrent to other collaborators," Salah Abdel-Atti of Gaza's Independent Commission for Human Rights said.

But rights concerns win little sympathy among Palestinians, who widely see informing for Israel as unforgivable treason -- even among Gazans opposed to Hamas' iron fisted control of the territory since 2007.

Ramiz Abu Jazar, a Gazan whose brother was killed by Hamas in intra-Palestinian fighting in 2007, said he's all for killing collaborators. They are "like cancer in society," he told the AP. "They sold their souls to the devil."

There have been instances of Palestinians collaborating out of political conviction. Most embarrassing to Hamas, the son of the group's co-founder Sheik Hassan Youssef spied for Israel between 1997 and 2007, dubbed "the Green Prince." Now in the U.S., Mosab Yousef later wrote that he did so in part out of revulsion at Hamas' actions.

But the large majority of collaborators are believed to do so because of blackmail or financial gain.

"Everything starts and ends with money," said an operative from Israel's domestic intelligence agency, Shin Bet, which runs Palestinian informants. Many are recruited at Erez, Israel's border crossing with Gaza, when they seek an entry permit, said the operative, who spoke on condition of anonymity because he is not authorized to discuss the issue with the media.

On the Gaza side of Erez, a large sign put up by Hamas warns travellers against being recruited by Israelis.

An AP reporter this week witnessed firsthand how the Israeli military uses access to Israel through Erez to get information from Palestinians.

On the Israel side outside the crossing terminal, a Palestinian businessman who had just entered from Gaza sat waiting for his brother, who was crossing with him but was held up by border officials inside the terminal.

A uniformed army lieutenant speaking Arabic approached the man and promised to help his brother, but first asked him dozens of questions about life in Gaza, from the number of factories damaged in the latest war, to the mood on the streets and power supply. The questioning -- casual in tone -- lasted about 15 minutes, and the man answered with little hesitation.

In the end, the officer insisted on taking the man's mobile phone number. The brother emerged soon after.

Hamas' Interior Ministry, which is in charge of security, says it has executed 12 collaborators since 2007 after closed-door trials.

Rights groups say another 53 alleged collaborators were gunned down by Hamas militants in that same period. Often, they were dragged out of prisons where they had been detained on suspicion of spying and were shot.

The husband of the widow who spoke to the AP was recruited around a decade ago, when Israel still directly controlled Gaza before its withdrawal from the tiny Mediterranean coastal territory in 2005.

The man once worked in Israel as a garbage collector, at a time when thousands of Gazans were allowed to enter Israel daily for work. But his permit was revoked because of his involvement in a car theft, his wife said.

His wife began making frequent trips to neighbouring Egypt to buy goods to sell in Gaza. When he tried to do the same, Israeli security agents stopped him on the Gaza side of the border. They offered him his Israel work permit back in exchange for collaboration, the wife told the AP.

Later, his wife grew suspicious because he was frequently going up on the roof of their house to make phone calls. When she confronted him, he confessed and told her, "I am not hurting anyone. I just give them a phone number, a name or information on a tunnel."

She did not join her husband in collaborating until 2008, when she was allowed to accompany one of their children being treated at an Israeli hospital. She was asked to go to the hospital's security office, and there an Israeli gave her money to buy presents for herself and her children.

A few days later, he gave her $14,000 along with instructions to leave the cash in various drop points around Gaza to pay other informants. "We left money under rocks, in garbage bins and by walls," she said.

Shortly before their arrest in 2011, she said, the husband received a call from the Israelis, who described a car to him and asked him to head immediately to the main road outside his home and wait for it. When he saw the car, he called the Israelis and reported that two people were in it.

More than an hour later, she said, the Israelis bombed the car, killing its occupants -- apparently militants.

During the last round of Israel-Hamas fighting in 2012, several senior Hamas figures were killed in an airstrike, and the husband and five other alleged collaborators were pulled from prison by masked men and shot to death at a Gaza intersection. The body of at least one of the six was also dragged in the street by a motorcycle, though it's not known if it was that of the husband.

The widow was convicted in a Hamas court and sentenced to seven years in prison. She was pardoned in December to look after her children.

Now she struggles to raise her children with little money. She did not speak of being harassed because of her conviction, but said: "the neighbours give me insincere smiles, but I know what they are thinking of us."

She reflected little about the rights or wrongs of working with Israel -- showing a mix of denial, a desire to defend her husband's reputation and a relief that the fear of those years was over.

"My husband was a kind man," she insisted. "He would never hurt anyone."