ITwas the verdict that finally ended one man's 17-year struggle for justice.

Stuart Gair, 42, found guilty of a Glasgow knife murder in 1989, had his conviction quashed yesterday after it was ruled he suffered a miscarriage of justice at his trial.

Mr Gair, who had protested his innocence throughout his time in jail, expressed relief as he walked from the court of appeal in Edinburgh.

He was only 25 when, by a majority verdict, a jury convicted him of the brutal murder of 45-year-old Peter Smith during a knife attack in Glasgow city centre.

Mr Smith, a former soldier of West Plean, Stirlingshire, was stabbed in the chest at North Court Lane on April 11, 1989, and died later from his injuries in hospital. Mr Gair denied committing the offence, but was found guilty and sentenced to life imprisonment.

He had put forward a defence of alibi, maintaining that he was in another part of Glasgow at the time of the murder, which occurred near toilets at St Vincent Place.

Mr Gair's fight to clear his name, which included petitions to the Scottish Secretary, has attracted a number of high-profile campaigners. His case was referred back to the Appeal Court by the Scottish Criminal Cases Review in 1999, which was set up to investigate alleged miscarriages of justice.

In 2000, he was freed on appeal, and began a lengthy series of court hearings.

The question of identification was the key issue at the trial and lawyers acting for Mr Gair argued that, crucially, the Crown had failed to disclose important information to his defence before or at the trial.

During the trial, a witness, Brian Morrison, who was 19 at the time, identified Mr Gair and his former co-accused as two men he saw come out of the toilets and go in the direction of North Court Lane, a well-known hang-out for homosexuals.

He said he had a good look at the two young men and studied their faces carefully. But in previous statements to police investigating the murder, he had given conflicting information.

During an initial statement, he said he would definitely be able to identify the two men he saw and that one of them had threatened him.

But later he told officers: "I have to tell you that a lot of what I have already told the police is not the truth and I made up some of it to attract attention to myself."

Mr Gair's defence counsel, Gordon Jackson QC, argued that if this information had been available to his lawyers at the trial, Mr Morrison could have been cross-examined in such a way to show that the jury could not trust a word he said. Mr Morrison gave evidence during Mr Gair's appeal process and the defence counsel reminded the judges of his demeanour: faced with any difficult question, he burst into tears.

He told the Appeal Court: "All the details I gave were given to me. I saw nothing at all."

A note had been attached to Crown papers for the trial which said at one point he had signed himself into a psychiatric hospital. It commented: "Morrison and his vivid imagination certainly set the police off on the trail of a red herring initially." Mr Jackson argued that all this information had been available to the Crown, but the defence had received none of it. He maintained that MrMorrison had been a key witness at Mr Gair's trial.

The Crown accepted before the appeal court that the four statements given by Mr Morrison should have been disclosed to the defence, but argued that no miscarriage of justice resulted from the failure to do so.

It was claimed that even without the testimony of Mr Morrison there was still "ample evidence" to conclude that no miscarriage of justice had resulted.

Lord Abernethy, who heard the appeal with Lord Kingarth and Lord Sutherland, said yesterday: "Morrison was a very important witness, even if not an essential one."

He said the Crown relied on Mr Morrison's evidence to show that Mr Gair was in the lane and invited the jury to accept it as credible and reliable.

The senior appeal judge said: "In our opinion, there is no doubt that all four of Morrison's police statements should have been disclosed to the defence. These statements showed that Morrison was prepared to tell lies, to fantasise, and to change his account when it suited him.

"Non-disclosure of the information meant that there was no equality of arms between the Crown and the defence in relation to Morrison and the defence were deprived of a powerful argument on the crucial issue of identification.

"The possibility that the jury might have reached a different verdict if the police statements and other information about Morrison had been disclosed is in our view real and certainly cannot be excluded."

Convictions quashed

Robert Brown

In one the longest-running miscarriages of justice Mr Brown, originally from Drumchapel in Glasgow, served nearly 26 years for a crime he did not commit. He was an unemployed teenager when convicted of murdering Annie Walsh, 51, at her Manchester flat in 1977. He was sentenced to life, but freed in 2002.

Thomas "TC" Campbell and

On their third appeal two years ago, the convictions of Thomas "TC" Campbell and Joseph Steele were quashed. By then, the Glasgow men had spent two decades in prison following the so-called Ice Cream Wars murder case in which six members of the Doyle family died in the Ruchazie area of the city.

Joe Steele Paddy Hill

One the Birmingham Six and founder of the Glasgowbased Miscarriage of Justice Organisation (MOJO). Mr Hill, who has made his home in Scotland, spent 16 years in jail after being wrongly convicted of the IRA bombings of two Birmingham pubs in November 1974, which killed 21 people. Mr Hill was freed in 1991.

Andrew Smith

After 20 years in prison, Mr Smith was freed in 2000. He was convicted of murdering Richard Cunningham in 1977 following a struggle in a pub in Larkhall, Lanarkshire. Crucial evidence at the time suggested the fatal injury had been caused by a kick to the head. Pathologists eventually concluded it was more likely to have been caused by a fall.