One day in August, Mark Daly was walking to his flat in Stockport to pick up his police uniform when he was surrounded by a group of officers from internal affairs. They arrested him on suspicion of committing three offences: obtaining a pecuniary advantage by deception (his police wages), presenting false documents (he didn't let on that he had worked as an undercover reporter on his police trainee application form), and damaging police property (he made a hole in his bulletproof vest to hold a pinhole camera and battery pack).

So ended Daly's seven-month undercover operation for the BBC, during which the 28-year-old had been investigating racist attitudes among Greater Manchester police trainees. "They put me in the cells for the night," recalls Daly. "It was bizarre. I'd been working as a probationary police constable, sorting out domestics, arresting people and putting them in cells. Suddenly I was on the other side." He has since been released on police bail.

Daly denies only one of the charges: there is no question of him having obtained a pecuniary advantage. "The wages have been kept in a bank account and we've offered three times to pay the money back," he says. He admits that he did present false documents in order to become a trainee: "If I'd said I had been an undercover journalist for five years, I wouldn't have had a chance of getting in." As for the third charge, he concedes that he did damage the vest, though a BBC spokeswoman has announced that the corporation is prepared to pay for its repair. Even now he's not sure who turned him in.

With that pinhole camera, Daly filmed scenes which, he claims, demonstrate the shocking extent of racism among a large minority of his fellow 120 trainee officers (all but one of whom were white) at the Bruche National Police Training Centre in Cheshire.

Daly says the BBC decided to investigate Greater Manchester police because its chief constable, David Wilmot, had said in 1998 that the force was institutionally racist and that it would strive to eradicate such attitudes. "We wanted to find out what progress they had made. What the programme shows is that they're failing," says Daly.

In one scene to be shown in tonight's programme, a trainee is filmed wearing a Ku Klux Klan mask and threatening to beat up an Asian colleague. "He'll regret the day he was ever born a Paki," he says, before adding that his aim is "to eradicate the whole fucking country of people like him". Daly also recorded racist remarks made by other trainee officers. One recruit said murdered black teenager Stephen Lawrence "deserved to die", that his killing was "a good memory" and that white racists "should be given diplomatic immunity".

"I think a lot of people will be surprised," says Daly. "One thing I want to make clear, though, is that it doesn't only implicate Greater Manchester police. There were trainees from lots of other areas and our evidence is indicative of a shocking problem."

What drew a Scots-born white journalist to the undercover job? "It was a challenge. Nothing like this has been attempted before. I also thought it was important to investigate the issue - all of us at the BBC were happy that there was a strong reason for doing this.

"But it was a real strain, no question about it. I was hanging about with guys whose views were abhorrent, but I couldn't challenge them. That said, I met a lot of people who in other circumstances I could imagine being friends with." But that can't happen now? "Christ, no. Even those who are innocent will treat the programme as a betrayal."

The programme has already been derided by home secretary David Blunkett, who attacked the BBC for its "intent to create, not report" the story. "I was surprised by the ferocity of what he said. The police and the home secretary are determined to stamp out racism, so they should be interested in seeing this rather than condemning it," says Daly. "We believe that the evidence we're presenting in the programme could not have come to light in any other way. I'm happy I did the right thing."

Would he do it again? "It was a once-in-a-lifetime opportunity," says Daly. "Never again."