Dressed in jeans and a tight headscarf, she stood in a makeshift courtroom with plastic chairs and ­tables and a television set hanging from the wall. She barely said a word. At the moment of sentencing, when the chief military judge in the Palestinian city of Jenin jailed her for 20 years' hard labour, Taghrid al-Tibi held one hand to her face in shock and sadness. Then she was led away.

Divorced, unemployed and only 21 years old, she was one of the few Palestinian women convicted of treason. Her crime: collaboration with the Israeli security services.

Hers is a grim story of an unhappy life and naivety. Enticed out of the occupied West Bank and into Israel, then plunged into a high-risk spying effort that lasted for five months until her capture, Tibi was lucky to escape with her life: collaborators, who are nearly always men, are so reviled among Palestinians that many are either shot in the street or sentenced to years on death row.

She did not speak to journalists after her hearing last week, but accounts from prosecutors involved in her case paint a scattered picture of Tibi's life. Originally from Tulkarem, she was living with her family in Nablus, in the north of the occupied West Bank. She attended school until the age of 16 but then her father ordered her to marry an older man. It was an unhappy marriage: she told the court that he had forced her into prostitution. Within a few years she was divorced and increasingly cut off from her family.

Several months ago Tibi met an Arab-Israeli in Nablus, named Mahmoud, who persuaded her to join him on a trip back into Israel. She agreed, though it should perhaps have raised her suspicions when he arranged a rare permit for her to leave the West Bank.

The couple slept together and then he took her to an office in Tel Aviv, where Israeli security service agents apparently confronted her with a video of her in bed with the man, the prosecutors said. They threatened to pass the video back to her family unless she helped them and also apparently promised her 100,000 shekels (£15,500) if she would pass them regular information about a group of militants in Nablus.

She told her story in a six-page signed affidavit for the prosecutors. It began with her name, date of birth and her background. Then she said: "Five months ago I met this guy, Mahmoud, I didn't know his full name. He was working inside the Green Line [within Israel]. I sat with him a couple of times in the park. He took me on a visit. We went to Tel Aviv. Inside the offices there was an Israeli commander and he knew everything about me.

"He asked me to relax for an hour and then he said he wanted me to give him information on 10 wanted men in exchange for 100,000 shekels."

She returned to Nablus and for five months she spent time with several ­militants, men she knew only by the pseudonyms they used to protect their identity. She would regularly head out to the Israeli military checkpoint at Hawara, on the southern edge of the city, and pass on information to an Israeli contact.

However, she learned little about the militants or their activities and her information was always of little value, the prosecutors said. None of the militants she met were arrested or killed.

Eventually the militants became suspicious of her questions. They confronted her, she confessed and then in May they handed her over to the Palestinian authorities in Nablus.

At the end of the affidavit, she was asked if she wanted to add anything to her statement. Tibi answered: "I'm really sorry for what I've done but I'm glad that I haven't been the reason for anybody getting hurt."

Tibi's case was passed to the military court and Major Alam Dalbeh, the military prosecutor in Jenin, sat with her in his second-floor office for an interrogation. She volunteered the entire story, he said.

"Her father married her off when she was 16 and her husband was corrupt and immoral," said Dalbeh. "All these things contributed to her becoming a collaborator, but the law is the law. Still, it was very hard for us to question her. She confessed very fast, faster than in any other case like this that I've dealt with before. She was very sad. She kept saying: 'I'm sorry. I won't do it again.' She said: 'I'm a victim of my father and my husband.'"

She was offered the chance to hire a lawyer to defend herself, but refused and was given a court lawyer. None of her family appeared at court for the hearing.

Prosecutors said her sentence of hard labour meant she faced years of menial tasks inside the jail, mostly cleaning and washing. She may have to serve the full 20 years, although it is more likely that she will be pardoned well before her sentence ends – the Palestinian president has the authority to pardon prisoners and often does so, usually on religious holidays.

However, since collaboration is such a reviled crime in Palestinian society and given that her family appears to have disowned her, she is likely to face another challenge in finding a place in society when she is eventually freed.

Dalbeh, who has prosecuted other collaborators in the past, said the crime was seen as "very disgraceful" in Palestinian society. "Many members of the resistance have been killed or arrested in the past because of collaborators, because of people like her. We are in the stage of building a Palestinian state and such collaborators are affecting the establishment of the state," he said.

Other cases had also involved sexual entrapment, Dalbeh said, or the promises of permits to enter Israel or visas to live in countries abroad. "Their tricks are very well known to us," he said.

"They used her like a slice of lemon," said Mohammad Hamashe, another prosecutor. "They squeezed the juice out of her and then threw her away with the rubbish."

At a glance

According to B'Tselem, the Israeli human rights group, 26 Palestinians have been sentenced for crimes of treason or collaborating since the Palestinian Authority was established in 1994.

Some prisoners have escaped or died in jail, others have had their sentences commuted by the president.

B'Tselem's figures show only one execution for treason – that of a 27-year-old man from Rafah, Gaza, who was killed in January 2001 at the beginning of the second intifada, the most recent Palestinian uprising.

But the statistics do not tell the whole story. Many collaborators are rounded up before they reach court and shot in the street by militants. Nearly all have been men.