On November 26 2005, I travelled to Iran to research and film undercover the documentary Execution of a Teenage Girl. The programme tells the story of Atefah Sahaaleh, 16, from northern Iran, hanged in public in August 2004 for having had sex outside marriage, a so-called "crime against chastity".

A number of Iranian journalists and lawyers had strong evidence that the judiciary had broken Iran's own law in executing Atefah. But because of the censorship of the Iranian press, it was extremely difficult for them to get the truth to a wider audience.

My executive producer, Paul Hamann, who is also the chairman of anti-death penalty charity Reprieve, was passionate about the project.

But if we asked the Iranian authorities openly for a visa to investigate such a story, we would have been laughed out of the embassy.

After very careful consideration, we decided we should travel to Iran undercover, posing as tourists.

I'd filmed in Iran this way once before, in 2003, but it's a horrible way of working. From the moment you arrive in the country, you are breaking the law.

The Foreign Office regards it as reckless and tells you firmly not to do it. If you get caught, you may be accused by the Iranian authorities not just of being a journalist there without permission but of spying.

But any risks I'd be taking would be dwarfed by those taken by the Iranian members of the team. If they were caught working with a British undercover journalist, the consequences would be severe.

On my 2003 trip, I'd had a wonderful fixer and the trip had gone off without any problems. But he'd then collaborated with a project that the Iranian authorities did not like and had spent three months in prison. That was under the so-called reformist President Khatami. Now new President Ahmadinejad has shocked and depressed my friends and contacts in Tehran. The rulebook they'd lived by under Mr Khatami has been torn up, and they don't know what to expect. Many sounded scared.

After July 2005, and Ahmadinejad's election, even tourist visas became difficult to come by. Finally, I got in by pretending to be engaged to my half Iranian, half British colleague. We bought a £17 ring from Kentish Town High Street. My "fiance" and I left for Iran on November 26, carrying a basic undercover filming kit in our bags.

The deadline for my return was non-negotiable; my mother's 60th birthday party on December 21. If I didn't turn up, my family would never forgive me.

Day one



The plane to Iran is virtually empty - perhaps 20 passengers.

We have to report our movements to our tour company, which will report our whereabouts to the tourist ministry. But because P, my colleague and pretend fiance, is half Iranian, we'll be quite independent.

In the summer of 2003, just months after my last undercover trip to Iran, Canadian/Iranian photojournalist Zahra Kazemi was arrested for photographing Evin prison in Tehran. She was raped and badly beaten in custody before the interrogators realised she was a Canadian citizen. Tragically, she died of her injuries in prison.

As the plane prepares to land, British Airways passes on the message that we are required, from now on, to conform to Iran's Islamic dress code. The cosmopolitan women around me, dressed in jeans and trousers, pull scarves out of their bags.

I'm endlessly fascinated by the individually stylish ways Iranian women find to wear their hijab. I have the same scarf I wore for my last trip. It's huge and soft and doubles as a security blanket - we were very lucky that time.

We land in Tehran airport and reach passport control. P is asked in detail about me and whether I'll convert to Islam before we marry. He assures the guard that I will, and we're in.

The officials don't look for or find the camera or microphone in my suitcase.

Day two



We visit the tomb of the medieval Persian poet Hafez in a park at sunset. It's a regular evening pilgrimage for young Iranians. They walk down the avenues of lemon trees and past the shallow reflecting pools to the raised tombstone, where they recite his poems silently, like prayers. In the shadows, couples hold hands.

We talk to the guys on the neighbouring table to us in a teahouse - they tell us many of the girls in this romantic place are actually prostitutes, students who need money.

Every so often the moral police clamp down on parks and teahouses where girls and boys spend time together. All these guys can tell stories of being stopped by the police. But they live a kind of double life, with a highly attuned sense of what they can get away with.

From what I've seen and heard, young middle-class Iranians break the law daily, if not hourly. Our wonderful young fixer watches Seinfeld and Friends on illegal satellite and has a very beautiful girlfriend with whom he may well commit crimes against chastity on a regular basis.

That's probably why Atefah's story so horrified young Iranians. In the re-telling, they've romanticised her story somewhat.

Though Atefah came from what was originally a good family, and had cousins who went to university to read law and botany, her own childhood was tragic. Her mother died in a traffic accident and her father became a heroin addict. She lived with her grandparents and, though her grandmother was very fond of her, her grandfather seems to have been a bully.

By the time she was in her early teens, Atefah seems to have been wild, the kind of girl who was asking for trouble, who didn't care about rules, who answered back. She was also too pretty for her own good, apparently.

I imagine her as a kind of Iranian Emily Lloyd in Wish You Were Here, who cycles round the town showing off her legs, looking for trouble. Girls aren't allowed to use bicycles in Iran but I'm sure Atefah found other ways of drawing attention to herself. A caller from her home town of Neka to Radio Fadr said men used to wolf-whistle at her.

Day five: Tehran



After checking into our hotel, and changing taxis twice, we finally meet our team in the safe flat we're using. It feels fantastic to get going and we brainstorm about how we're going to spend the next few days.

After Atefah's execution, which seems to have caught people almost entirely by surprise, there was a wave of revulsion at what the authorities had done to her and many people phoned the dissident media.

A few journalists followed up the story and managed to establish the key facts of the case. The authorities had referred to Atefah as a 22-year-old but her birth certificate proved she was 16.

Executing those under 18 is hugely controversial in Iran. The government promised to stop the practice in 1995 but, according to campaigners, it has continued in secret. In Atefah's case, the authorities had been caught red-handed. But why were they so eager to execute her that they'd falsify her real age?

I'm amazed that we've got a list of people who are prepared to go on the record to say what they know about the case. They include formidable lawyer Shirin Ebadi, whose Nobel Peace Prize gives her a protected status.

But interviewing people from Neka and those close to Atefah will be incredibly difficult. We have some evidence that police corruption played a key part in Atefah's story. And, after her death, the police had made the rounds of a number of people close to Atefah and threatened them not to talk to the media.

So we have many sources who we won't be able to film on camera and whom the authorities must never know we're meeting. We are trying to line up safe houses.

Our top priority among our list of our potential on-camera interviewees is Atefah's father, Safer Ali. We don't know what to expect of him. His drug problems had meant he'd been a hopeless father, although he apparently adored his daughter and was desolate now. Since her death, he'd gone cold turkey and is trying to reform himself. He's left Neka.

Finding a former drug addict, who has no telephone, in a strange city six hours from Tehran ... getting him to a safe house ... making a judgment call about whether he is really in a position to give informed consent about giving an interview ... all without alerting the authorities.

It's a nasty seven-hour drive across the mountains to get to him. We're all praying that Safer Ali will be at his last known address and be cogent. Our fixer, J, sets off and we don't know when he'll be back.

Day six: Tehran



According to Iran's constitution, with sharia law placed over any parliamentary law, reformist legislation can be ignored at any time by any sharia judge. Under sharia law, the age of criminal responsibility for a girl is nine (for boys it is 15). A girl of nine can be tried and sentenced in the same way as a man of 40.

We have obtained copies of the two court verdicts; the first, from Neka court, giving Atefah the death penalty for crimes against chastity, and the supreme court of appeal verdict, surveying the case and ratifying the death penalty.

The Neka court verdict does not refer to Atefah's age. But there were obviously some additional papers accompanying this verdict that we don't have.

In the supreme court verdict, Atefah is described as 22. An anonymous web article said: "The judge said his eyes were as good as a birth certificate. She was 22 and an adulteress."

The judge also said on another occasion that Atefah told him she was 22. It's just conceivable that she lied about her age in the hope it would get her out of trouble. But it would have taken a moment to check her birth certificate or school records. Tragically neither she nor her family knew that making a fuss about her real age might have saved her life.

Day seven



I'm desperate to find out about Atefah's boyfriend, who seems to have been the one good thing in her life.

We are told that this boyfriend adored Atefah and wanted to marry her. He was 19 or 20 and worked for a state agency. The relationship seems to have continued for a number of years and he visited her in prison. But she was too young to marry and, presumably, his family would have disapproved at his association with this fallen girl.

J returns from his mission to find Atefah's father. J looks completely exhausted, having spent 14 hours on the road. He was found living in a high-rise and is apparently drug free. He kissed J shoes in gratitude for trying to help his daughter's case. Safer Ali has promised to come down to Tehran in two days. Sadly he couldn't come any sooner. I'm worried he'll get cold feet.

Day nine: Tehran

I'm getting through my shot list reasonably well, but there are a few things that are proving very difficult, like filming the supreme court, which backed up Judge Haji Rezai's verdict of execution on Atefah.

Judge Haji Rezai managed to get Atefah's appeal through the supreme court at many times they normal speed. Atefah was arrested at home, washing rice, on May 2 2004.

After three days, they held a trial and she was sentenced to death. (God knows what happened to her in those three days, as she confessed to her sexual relationship with Ali Daroubi, which she'd never done before. Did they beat it out of her?)

On June 6, the appeal hearing was scheduled in Tehran and, by August 12, she was dead. We've heard that, in normal circumstances, a serious case like murder would take a minimum of six months to reach the appeal stage.

It is very hard to believe that the speed with which Atefah's case was concluded merely down to the authorities' desire to be efficient. It's a crucial part of the story but it's going to be really hard to tell visually, and indeed journalistically, since the truth is locked up in the sealed files of the supreme court.

Only certain vehicles with the right permission are allowed into the central area that houses the supreme court. During daylight hours at least we take a taxi, but there are "no filming" signs everywhere and it is just too difficult to get decent shots. We'll go back at night.

Day 10: Safer Ali



He finally turns up, overexcited and exhausted after an eight-hour journey. He's sunburned, with bright eyes and is wearing an army jacket. Knowing Atefah's photos as well as I now do, the family resemblance is very strong.

Safer Ali takes the strangeness of a foreign, and female, director in his stride. It's a very good interview, very impassioned.

He was not there for his daughter when she needed him most. She was abused by Ali Daroubi, by a man he knew, and he did not spot this or protect her from it. Though he tried as hard as he could, with no money, to get a lawyer for his daughter, surely there was more he could have done? The truth is that his heroin addiction made him a pretty useless human being for years. But there's no doubt at all that he's very sorry now. He seems clean and determined to stay that way.

The strangest thing is hearing him repeat Atefah's words. For example: "Atefah used to say the moon won't always stay behind the clouds - and she was right." You get the sense she was a very articulate teenager.

Day 11



We pick up J and N and set off north. As we hit the mountain road just north of Tehran, I finally understand why everyone is so frightened of this drive. For three hours at least, as we go over the mountains, it's just a single lane, with a vertical drop into the stony valley on one side and kamikaze lorry drivers overtaking each other at full pelt.

In a bleak apartment block we finally meet with our key sources (who cannot be identified for their own safety). Our interviews last an overwhelming six or seven hours. There are a lot of tears. It is clear that Atefah's death changed them. One of them was very religious. She did not believe such a thing could ever be done in the name of Islam. Another confronted the judge very directly on a number of occasions and has had to flee Neka.

We learn a lot more about Atefah's dysfunctional family. After her mother's death, Atefah's little brother drowned in the river.

The details of Atefah's abuse by Ali Daroubi, which Atefah told her aunt about in prison, are horrendous. Apparently she could only walk on all fours afterwards because of the pain. Her family at the time seem to have hated and punished her rebellious behaviour but not found out its root cause.

A number of people we've talked to are convinced Atefah was killed to shut her up.

Their general reading of the situation is that Atefah was taken advantage of by the moral police in Neka, who knew of Ali Daroubi's abuse and abused her too. Then, for some reason, they decided to get her out of the way. Atefah never seemed to follow rules and she didn't seem to know the rules about keeping quiet. So they used Ali Daroubi as a scapegoat to prosecute Atefah and get her out of the way.

We have heard a similar interpretation of events from many people but it is so hard to substantiate.

However, two months after Atefah's death, there was a big wave of arrests in Neka and two moral policemen were arrested, accused of organising a child sex ring.

Day 13



As we enter Behshahr, (site of Atefah's prison and courthouse), we suddenly come across four mullahs in quick succession, out and about Behshahr's main street. We've been in Iran almost two weeks. Surprisingly, we've only seen one mullah so far, in Shiraz (he was very young and friendly, and talked to us before getting onto the back of his friend's moped and driving off into the night).

We drive through Neka. It's late morning now, the sun has gone. Neka is a grim small town. There are no old buildings at all to make it picturesque. It was very badly flooded some years ago. It doesn't seem poor, just ugly.

Looking round Neka, Judge Haji Rezai's excuse as to why he felt it necessary to rush Atefah's trial and execution through so quickly is somewhat ironic. He felt that "Neka was becoming lax and immoral, and he wanted to clean it up, particularly because it was the summer months, and lots of tourists were stopping off."

I feel sure that it's a very long time since any tourist has stopped in Neka, except perhaps to find a toilet.

Around lunchtime we arrive in Sari. I feel completely unable to shake off the horrible atmosphere of this whole area.

Day 14



It's too dangerous to film in Neka in broad daylight, so we leave at 7am. It's a tiny town, just a few streets. There are absolutely no westerners here. Neka is famous for one reason, and one reason only - Atefah. I'm getting very twitchy.

Day 15 - Neka



We got up at 4am - again. Goodness knows what the hotel management made of it.

By 5am we were in Neka to film the square where Atefah was executed. It's a piece of scrubland just a couple of streets away from her house. There's chicken wire round one edge. It's perhaps the size of a football pitch, empty, a wasteland. Around the edge are houses. Apparently the female guard who Atefah's friend accused of persecuting Atefah lives in one of them.

We've tried to come up with alibis for everywhere we've filmed. Our alibi today was that we were driving south, and had stopped to buy bread, and for J to have a nap. People do drive at night in Iran as it's marginally safer, but it was a lousy alibi. Any Neka policeman would see through it in an instant, particularly one with a guilty conscience.

We sat in the car with the engine off, as I filmed the sun rising behind the buildings.

Atefah was killed at dawn, six in the morning. On the day of Atefah's execution, the Mr N told us, this patch of wasteland was nearly full of people come to watch.

According to sharia law, execution for sex outside marriage should be by stoning, but shortly after the revolution, the Iranian authorities took to hanging people from cranes no matter what the crime. It's quick, cheap, and provides a spectacle for the crowd.

We've seen footage from other recent executions in Iran. The technique is so perfunctory. A lorry with a crane is parked up. A noose is put around the victim's neck, and the victim is blindfolded. Some people have told us that a mullah says words from the Qur'an, but in the footage we've seen the killers have been perfunctory. The crane arm is then raised to its full height, and with it the noose. The victim dies of strangulation. The body swings in the air. B told us that sometimes they move the crane arm slowly from far left extension to right to display the body to everyone in the crowd.

Atefah's friend told us that he saw a couple of men in the crowd filming Atefah's execution on mobile phones. Someone rushed to her aunt and said - "We've filmed it, we'll put it on the internet." So far this footage hasn't surfaced. I don't know if I could bear to watch it. A sixteen-year-old girl's execution in accordance to laws written in the early middle ages, filmed on a mobile phone.

Haji Rezai put the noose around Atefah's neck himself, and left her body hanging for 45 minutes. Then he drove away in his black Peugeot 406.

Day 16



We are so relieved to leave the Neka area. We will come back if any of our remaining leads bear fruit but we think it is just too dangerous to stay in Mazandaran any longer - there is really no plausible reason why a group like us would be hanging around. My one hope is that Atefah's boyfriend will come forward and talk to us. We just don't know what happened to him. According to Atefah's friend, Hussein visited her in prison all three times she was arrested. That means their romance continued over at least two-and-a-half years. But after Atefah received her death sentence, she never saw him again, though she was in prison for a further two months. No one knows where he is at the moment. Did the relationship become too much for him? Did his family forbid him to associate with her, now that her secret was out? Did the police chase him off? We have a number of people looking for him. I want to know for Atefah's sake. I really want to find out that there was a good reason he didn't ever say goodbye to her.

Day 17 - interview Shadi Sadr, lawyer



Judge Haji Rezai made, from my notes, the following procedural errors in Iranian law:

·He got Atefah's age wrong - she was 16, not 22 as he described her. (This meant that he conveniently sidestepped the freeze in place on executions of those under 18)

· He convicted Atefah for "adultery" though she was not married.

·He failed to give Atefah a chance of a second appeal

· He failed to give the family notice of Atefah's execution date

· He executed Atefah himself though the judge is meant merely to preside, with the killing being done by a separate official.

In Britain, the standard of proof needed for conviction is "beyond reasonable doubt". In sharia law it is "the knowledge of the judge".

Day 18 - Khomenei's tomb



We have now heard from five sources that Judge Haji Rezai was involved in the political purges of 1983. We sit with A as he tells us what happened to his brothers, fairly typical of the leftwing students who were initially swept up in the revolution then witnessed their friends being killed as the Islamists turned on any opposition. Mohammad Hoshi's fiancee, aged 17, was arrested for having a flyer for a political party in her bag. He never saw her again. She was executed in prison.

Judge X famously flew from place to place in a helicopter, issuing mass execution orders. Another one ordered his own son to be executed. S tells us that Haji Rezai was one of 95 judges hand-picked by the Ayatollah Khomenei to preside over the revolutionary courts in Tehran, and to orchestrate the clean-up.

If Judge Haji Rezai is indeed one of these 1983 judges, a lot falls into place. They are seen by many as virtually untouchable. Either because the revolution is grateful to them for its survival, or, more cynically, because they know where the bodies are buried and would bring others down with them.

We go back to J's to continue backing up the rushes. Brain dead, we watch Seinfeld and Friends on his illegal cable.

Day 19 - the embassy



We have seven tapes of interviews, five tapes of locations and countless transcripts of off-the-record recorded interviews.

I feel I have a very clear, if heartbreaking, idea of the chain of events in the last two years of Atefah's life. Though sadly it will be very difficult to substantiate much of what we've been told on one hand, and on the other hand we cannot reveal the identify of many of our sources, I think we can say enough to get the message through loud and clear.

I am very sad that we haven't heard from Atefah's boyfriend. But I don't blame him.

As far as everything else goes, I don't know if things have gone well because of all the careful planning, or if we've been lucky. There are lots of things I'd love to do still but the very strong and sensible message from above is - get back safely and soon, nothing else matters.

But all we have achieved so far is meaningless unless we get the tapes out.

P leaves, a couple of days earlier than me as planned, as the days when we try to get the tapes out are high risk. His girlfriend has apparently lost almost a stone in three weeks from worry about him as it is.

Day 21



The most horrible scramble imaginable. J and I are stuck for four hours at X as we pass on the tapes. The passengers have already had their last call by the time I arrive at departures. I feel sick with nerves but it absolutely must not show in front of the officials. There's another last-minute delay while J and I are questioned closely about our relationship - some official saw us hug the other day as we waved Arash off, he was understandably upset as he doesn't know when he will see him again. It is now 10.45. The plane was meant to leave at 10.15.

But bless British Airways; the plane is either late or, just possibly, waits for me. As I scramble on board, a steward says: "They didn't want to let you go, did they!"

Five tense days later, Paul Hamann breathes a huge sigh of relief as he receives the last of the rushes, which all got through safely.

· Monica Garnsey is the producer/director of Execution of a Teenage Girl, which will be shown at 9pm on Thursday July 27 on BBC2.