It's a standard part of police procedure that a caution is issued to a criminal suspect before questioning, the most important part of which is informing them of their right to remain silent.

But what happens when an experienced police officer in the middle of a high profile investigation into the murder of a 13-year-old girl forgets to remind the prime suspect of that right.

That's the dilemma Detective Chief Inspector Les Brown faces when he stood before trial judge Lord Cowie at the High Court in Glasgow on June 2, 1980 - his case on the verge of collapse.

READ MORE: Appeal over cold case Glasgow murder of Tracy Main

Glasgow Times:

Four months earlier Tracey Main had been found slumped against the settee of the lounge of her tower block home in Norfolk Court in the Gorbals, her trousers at her knees and seven stab wounds to her chest.

The attack had happened on February 5 while her parents were at work and she was off school.

Though her clothing had been removed there was no evidence of a sexual assault.

Suspicion fell on Docherty, nicknamed the Creeper, a 43-year-old unemployed man with the mental age of an eight-year-old.

He lived on the same second-floor landing with his common-law wife, a 73-year-old grandmother.

Neighbours had spoken to detectives of his furtive behaviour and bizarre appearance.

READ MORE: Glasgow Crime Stories: The murder of 10-year-old Andrea Hedger in Woodlands

Glasgow Times:

When interviewed he freely admitted knowing Tracy and could even describe how she had been found.

This created a dilemma for DCI Brown particularly given his mental age.

Did this mean that Docherty had killed Tracy or had he seen her body through the unlocked door after the police arrived?

However, one startling admission put a dramatic new spin on the murder investigation.

Docherty revealed during one interview that Tracy had been stabbed seven times.

This was explosive information, what police call specialist knowledge known only to the perpetrator.

Though the media had been told of the stabbing, the specific number used in the frenzied attack had not been disclosed.

DCI Brown decided there was now enough evidence to charge Docherty with Tracey's murder.

A few hours later criminal lawyer the late Joe Beltrami was having his first consultation with Docherty in Craigie Street Police Office on the south side of Glasgow.

Beltrami and Brown knew each other and were on good terms.

But they were on opposite sides of the divide now and what Beltrami discovered was to make that divide more of a chasm.

After further meetings with his client Beltrami became convinced of his innocence, particularly as there was no forensic evidence linking him to the murder.

But how could he explain Docherty's claim that he knew that Tracey had been stabbed seven times?

READ MORE: Glasgow Crime Stories: Len Murray and his client Tony Miller

His client told him that he had heard the information on a television bulletin.

Beltrami asked the BBC and STV if they would be willing to release copies of their coverage.

He discovered that one STV presenter had said the victim had been stabbed " several" times.

Could Docherty, with his low intelligence, have misheard the report and thought he had said seven.

Beltrami was certain that a jury would agree and clear his client.

However, he knew there was a lot of work still to be done before they could reach that point.

Glasgow Times:

Tracy Main funeral 

The public were horrified at the murder of an innocent young girl in her home.

A post mortem showed that the killer had put his hand over her mouth to muffle her screams.

There had been pressure on the police to get a "collar" and the jury might feel similarly pressured to deliver a guilty verdict.

In his 1988 memoir "The Defender, Tales of the Suspected" Beltrami said: "From the outset it was clear to me that Docherty did not realise he had been charged with murder "It was equally clear that, without difficulty, one could persuade him to say anything."

When leaving the police station after their first consultation he said to Brown: "Les, you must have the strong man.

"Thomas knows nothing about it."

To which DCI Brown is said to have replied: "No, we have the evidence."

Glasgow Times:

During visits to Barlinnie Prison Beltrami realised that Docherty had no idea why he was there or that he had been charged with murder.

However, his client had been examined by two psychiatrists and deemed fit to stand trial.

That created another dilemma for the lawyer.

He did not agree with the diagnosis but knew that if client didn't stand trial there was a danger he would be sent to the State Hospital at Carstairs anyway and might never be released However Beltrami was confident of his client's innocence.

That confidence grew when he and Docherty's Q.C Hugh Morton made an astonishing discovery on the eve of the trial.

While reading DCI Brown's statement they discovered that he had failed to warn Docherty over his right to remain silent before charging him with murder.

Neither Beltrami or Morton could belief what they were reading.

If true it meant that any trial would have to be stopped once that revelation was made in court and their client allowed to walk free.

They checked Browns notebook to see how he had written down the caution and there was no mention of his right to remain silent.

It proved that anything said by Docherty after his arrest was inadmissible and could not be allowed in evidence.

That included the reference to the seven stab wounds, the cornerstone of the prosecution case.

But this revelation created yet another dilemma for Docherty's defence team.

If he walked free on technicality then people might not believe in his innocence.

Surely it was better not mention the caution error and let all the facts come out that would clear his name.

However Morton disagreed and said he must mention it when cross-examining DCI Brown in the witness box.

On the first day of the trial, the jury was told how Tracy's mother had discovered the front door open when she returned home from work and realising something was wrong went to a next door neighbour for help. Together they found Tracy's body.

The jury were also shown transcripts of the media coverage to prove there had been no previous mention of the seven stab wounds.

When DCI Brown gave evidence he said he had cautioned Docherty in front of his boss Detective Supt Ian Smith.

At this point, Morton got to his feet and pointed out that the caution was wrong.

The court was cleared and during a two-hour hearing before Lord Cowie Brown admitted that he hadn't written down the caution correctly, but had verbally advised the accused of his right to remain silent.

However, Detective Supt Smith admitted he had written down what Brown said and there was no mention of the right to remain silent.

The jury were called back in and the issue over the caution was explained to them, The murder charge against Docherty was withdrawn by the prosecution and the jury instructed to find him not guilty.

However far from being good news, Docherty's troubles were only just beginning.

Beltrami had learned of a contract out on his client from a local bookmaker and knew he would never be able to return home.

News had spread of the acquittal and there were already people gathering outside the court waiting to get their hands on him.

Beltrami asked for his client to be smuggled out the court and taken to a police station for his own protection.

Docherty was kept there for two days before being admitted to Carstairs as a voluntary patient for a month Meanwhile a full investigation was launched by both Strathclyde Police and the Crown Office into why the caution error had not been noticed before the start of the trial. The matter was even raised in the House of Commons by the local MP Frank McElhone.

Glasgow Times:

Thomas Main, Tracy's father with Det Supt Iain Smith 

A place was found for Docherty in a social work hostel in a secret location in England where he remained never returning to Glasgow.

In his 2005 memoir, 'Glasgow Crimefighter' Les Brown admitted that he had made a "bad" mistake over his failure too administer the correct caution.

He also hinted that they may even have got the wrong man.

Brown, who died last year, wrote: "The Tracy Main case has a legacy of lessons to be learned even by today's cops.

"The mystery of who killed Tracy Main goes on but who knows some day the truth may yet come out."