'I went to bed a few nights ago and, to be honest, if I'd had the bottle, I wouldn't have woken up the next morning."

Stuart Gair, the Stirlingshire man at the centre of one of Scotland's most contentious miscarriage-of-justice cases, is struggling to find the words to describe his most recent suicidal episode. "I am completely lost, " he finally says.

When we last met, Gair was in prison, still serving time for the murder of Peter Smith, who was stabbed to death in April 1989 near St Vincent Street public toilets in Glasgow.

During that meeting he looked rail-thin yet still boyish. Now, more than half a decade on, Stuart Gair is a changed man. His thin, lined face, weather-beaten body, unsteady gait and halting, staccato speech tell their own story.

These days he looks like the sort of person the average Glasgow commuter would cross the street to avoid. On a bad day he has the fixed, sleepy-eyed stare of the daily methadone user that he is. Today he is clutching a half-burnt roll-up cigarette that may or may not contain only tobacco, and is displaying the hunched, urgent street-shuffle of man on a mission only he fully appreciates.

But that's judging this book by its cover.

Listen to what he has to say and you discover a human tragedy behind the battered shell.

While Gair has brought about many of his problems through his own stupidity, he has also had others visited upon him. He carries around both sets like scars. During our meeting, on a sunny autumn afternoon, he constantly mentions being "lost". He lives day to day, even hour by hour. If he has a purpose in life, he has long misplaced it.

Only when he talks of the terrible wrong he believes was done to him by the Scottish judicial system does his mental compass kick in.

Then he collects himself and painfully pulls the pieces of his identity back into a recognisable reflection of himself. "I'm 42 years of age now and have been on bail for the murder since September 2000, " he explains.

He is sitting in an open-air coffee bar in Glasgow city centre, yards from where Peter Smith was murdered all those years ago. Gair intently pours three sugars into his coffee, shunning all offers of anything more nutritious. When asked what his life is like now, he says: "Schizophrenic." Then he quickly corrects himself.

"Actually, I don't have a life at all."

Minutes later we walk round to North Court Lane, a cobbled alley running behind Royal Exchange Square, parallel to St Vincent Street.

North Court Lane is one of the city's oldest streets - and, because of its proximity to the public toilets, which are a well-known cruising haunt, is often used for furtive rent-boy liaisons. It was in this area that 44-year-old Peter Dewar Smith, from the village of West Plean, near Stirling, met his death. This, says Gair, is the first time he has ever been in the lane. "I used to avoid St Vincent Street, the public toilets as well, " he says. "Now I'm here I feel nothing. Nothing. Because it's got nothing to do with me. Maybe I should feel disgusted or something, but I feel nothing. Everybody is different, I suppose."

The murder that has dominated his life for more than 16 years is complicated, but at the centre of the whole story are two undisputed facts. No-one has satisfactorily proved who murdered Peter Smith, an innocent man; and the accused, Stuart Gair, now a husk of his former self, still maintains he was framed for the crime. Then there's a question: where in this mess does the truth lie?

Peter Smith was attacked in the St Vincent Street area at around 11pm on Tuesday April 11, 1989. He took a single stab wound to his chest. The police version of the stabbing would later state he had been attacked by Stuart Gair and another man in North Court Lane.

Certainly, blood was found in that lane, and it seems reasonable that Smith staggered along St Vincent Street before collapsing into the basement toilets.

Smith, an unmarried ex-soldier, worked as a superstore manager and lived with his mother. He was worldly-wise, well-travelled and well-loved within his circle of family and friends. Of that circle, most suspected he was gay, but only his mother knew for sure: he had had an emotional conversation with her after contracting a sexually-transmitted disease.

She had accepted her son's homosexuality and they had kept it a secret between them.

Late on the night of April 11, she sat up waiting for him to come home, concerned because he was on another of his trips to Glasgow. He had probably never told her precisely what he was doing when he visited the city, but she had reason to be worried. On an earlier trip he had ended up in police custody after being found in the street without his shoes. He later speculated he'd drunk too much, or that one of his drinks had been spiked. After the incident he had expressed revulsion to his relatives about the city. Yet, on the night of April 11, he had visited Glasgow again, ending up near the St Vincent Street toilets. By 11.15pm he had been found with a single stab wound to his chest. He was rushed to the nearby Glasgow Royal Infirmary: crucially, he was still alive when he was admitted.

Stuart Gair claims that at this time he was at the opposite end of Glasgow, holed up in a B&B just off Great Western Road with his prostitute girlfriend Julie Porter (who was to die of Aids in 1992). Together they were watching a Clint Eastwood spaghetti western in the company of other DSS residents. One of the witnesses who recalls him being at the B&B that night is a man called Hector Wood, who later told me Gair couldn't have committed the murder because "he was with me all night".

For his part, Gair says the scenario presented by the police is unlikely: "It was impossible for me to have been there [at the B&B] and down in the city centre committing a murder. They timed it in a bus journey and it took 11 to 12 minutes, assuming you got a bus immediately. I'd have had to have got a bus, met a gay person immediately, taken him down the lane, stabbed him, left the scene, got another magic bus or taxi - although I'd no money because I was just out of jail - and then got back up in another 11 to 12 minutes and somehow got back into the house. It's not possible."

Gair's point about having no money is important. The first thing he did on the morning of April 12 - as Peter Smith was hanging on to life in the Royal Infirmary - was leave his B&B and head out to collect his GBP150 DSS cheque. He had only been out of jail for 48 hours following two consecutive sentences for minor offences. Typically, he used his cash to buy not just food but drugs as well.

Emerging from the toilets of a cafe after shooting up heroin, he was arrested by two uniformed officers. Neither policeman mentioned Peter Smith at this point. By the time Gair was being processed through HMP Barlinnie, local newspapers were running headlines such as: "Hunt for knife thugs steps up." The police said they had good descriptions of Peter Smith's attackers. A member of the public responded to an article in an evening newspaper asking for witnesses, and by April 18 this man was viewing an identity parade at Maryhill police station.

Stuart Gair was hauled in for this parade, having been told at the last minute that he was going to be charged with the attempted murder of Peter Smith. When Gair, who is 6ft 1ins tall, spotted shorter stand-ins he protested - but he was ignored.

Eventually two young men who had been found near the toilets on the night of the stabbing picked out two stand-ins from the parade. Only the man who had responded to the press article identified Gair.

Eight days later, at a court hearing, Gair told the proceedings he was innocent of the stabbing. Two days later he was back for another ID parade. This time another young boy who had been near the crime scene was brought in.

He picked out a stand-in and ignored Gair, before two police officers - a female and a male - arrived, viewed the line-up and identified Gair as someone they had seen in the area on the night of the stabbing.

At 10.25pm on April 29, 1989, in ward 65 of the Royal Infirmary, Peter Smith died from what was later described as "bronchopneumonia due to stab wound of the heart". Within 24 hours, Stuart Gair had been visited in Barlinnie and charged with his murder.

But the police had a problem. If witness testimonies from various characters found near the murder scene that night were to be believed, two men had stabbed Peter Smith. So, if Gair was the first man, who was the second?

Within a week a man called Willie McLeod had been arrested and charged with the crime.

The two police officers who were in the vicinity of St Vincent Street on the night of the crime had constructed photofits of two "suspicious" men they had seen leaving the area;

based on those images, McLeod was arrested in Buchanan Street bus station in Glasgow.

A self-confessed insecure and fundamentally vulnerable man, McLeod told me in an interview that he was later forced to finger Gair and implicate himself. He mentioned a knife in his story, and spoke about two other people - one called Edward Harkinson, the other simply described as Charlie.

More identity parades followed McLeod's arrest. The same three young men who had been trooped before Gair without identifying him were brought back. None identified Willie McLeod either. Then the two PCs who had identified Gair at the previous parade were brought in. They, however, identified Willie McLeod as a culprit.

In court 24 hours later, a hapless McLeod retracted every single shred of his incriminating evidence against Gair. He later said he was so nervous he felt physically sick. He told the judge the police had pressured him into lying.

But he wasn't believed. He was charged as Gair's co-accused and packed off to Barlinnie.

Then something odd occurred. At some time on August 23 or 24, 1989, Willie McLeod managed to cut a deal with the police. In return for fingering Gair, all charges against him were going to be dropped. McLeod was now the Crown's main witness against Gair.

But, when he took the stand, clutching a glass of water, he announced he had been asked by the police to frame Gair. "I don't even know Gair, " he explained.

As the afternoon proceeded, McLeod - after cooling his heels in cells beneath the court - flipflopped several times again. Every time he implicated Gair, he returned to the stand to say the police were making him do it to secure a conviction. Nobody listened to him. He was even allowed to sit in the public gallery as other witnesses came and went. These witnesses - all young men found hanging around the toilets on the night of the attack, all of whom had failed to identify Gair or MacLeod on identity parades - now stood in the dock and identified one or both of them.

Yet - bizarrely - one of the police officers who had helped make a photofit of someone who supposedly looked like McLeod then failed to spot him when asked to pick him out in the court. This was despite McLeod sitting in front of him in the public benches.

To say that the whole identification process of Gair and McLeod in these proceedings was a dog's breakfast would be polite in the extreme. One witness, who had been sitting in a car near the scene of the murder, and claimed he'd seen Gair there that night, subsequently retracted that evidence to me in an interview, and then to the Court of Appeal in Edinburgh.

The forensic evidence was, on close examination, shaky too: nothing conclusively linked Gair to the stabbing.

Gair's best bet was his alibi: Hector Wood, the man who claimed he had been with the accused in the B&B watching that Clint Eastwood film. Yet Gair's lawyer never called Wood as a witness. At 5.09pm on August 30, 1989, Stuart Gair was convicted of the murder of Peter Smith. Press reports noted that several jury members wept when the verdict was delivered. Gair received a life sentence.

'Iam living in a temporary furnished flat but it took my drug worker fighting tooth and nail to get me it, " explains Gair, sitting in the afternoon sun more than 16 years later. "They weren't going to give me a flat because I'm out on bail for a murder conviction. I can't get work either - nobody writes back to me when I apply for jobs. I'd take anything."

Gair served almost 12 years for the Peter Smith murder before the Crown allowed him to be released on bail pending an appeal case.

That didn't mean the verdict had been quashed: far from it. Yet over the years evidence has been accumulated that breaks down the original case against Gair piece by piece, allowing John Macaulay, the relentless solicitor now working on his behalf, to lodge appeal point after appeal point.

For example, witnesses I tracked down told me the police had bullied them into implicating Gair. Detectives said they'd "out" them as gay if they didn't comply. One young witness, Brian Morrison, whom I interviewed in Blackpool in 1999, said his mental health was in pieces because of the pressure to which he had been subjected. The chief Crown prosecution witness, Willie McLeod, told me: "My head was, to put it politely, f-ed up." Over several interviews, he claimed, the police had intimidated him so much that, even after several attempts before the trial judge to tell the truth, he caved in and fingered Gair as the murderer, despite knowing he was innocent.

In his original interview with me, McLeod explains what happened when he was arrested and questioned. "I says, look, I don't know what happened. So they [the police] started telling me about Stuart Gair: he'd a knife . . . they knew Stuart Gair had done it. So they're still sitting getting on at me . . . going on about they knew Stuart Gair had done it, knew I was there, and I'm still denying I was there.

"Then one of them was like that: 'Look, we know you don't know anything about it, but we really want to get this done. You'd need to tell us.' And I was like that: 'There's nothing I can tell you.' And they started explaining the case out to me - well, started explaining out to me what was supposed to have happened. And the next thing I knew I was repeating it back to them."

I later learned that the accomplices McLeod had mentioned - Edward Harkinson and the mysterious Charlie - hadn't even existed - at least, not in 1989. Charlie was a figment of his imagination, and Edward Harkinson had died 12 years before the crime. Another witness, Alan Gillon, also admitted to me that his identification of Gair in North Court Lane on the night of the murder had been a lie. The police, he claimed, had pressured him into making the fabricated statement.

All of these witnesses took the stand in the Court of Appeal in Edinburgh in May this year and explained that the police had threatened to "out" their sexuality unless they lied and implicated Stuart Gair in the murder of Peter Smith. But in their interim decision, made on June 7, the three senior Scottish judges hearing the case said they regarded these testimonies as unreliable. So although the witnesses had been believed when they identified Gair, they were now being deemed untrustworthy.

Mention was made in several places of pressure being applied by journalists and campaigners on these witnesses to make them say Gair was innocent. In fact, during all the interviews I conducted, the subjects were extremely keen to have their allegations of bullying and the framing of Gair by police on the record. One interview, for example, lasted several hours and ran to 61 transcribed pages - hardly the stuff of doorstep intimidation.

Gair was shocked by what the judges said in June. "All those witnesses likeWillie McLeod were called again, and they all stuck to their stories, " he explains. "So when I came out after hearing the interim judgement which said the verdict still held, I saw the media but was so downhearted all I could do was say, 'I'm sorry, ' and shake my head."

Sitting nursing his cooling coffee, Gair is now in limbo, something of a dead man walking, until a legal "procedural" is heard next month and the crucial next part of the appeal is heard early next year. Only then will he know whether he is being set free or not.

He spends his life in a way most people would find unrecognisable - within a netherworld of vague "pals" and "guys from the Salvation Army", or "calling in on my lawyers".

Meanwhile, powerful new evidence that again points to his wrongful conviction in 1989 has been discovered. Official Strathclyde Police notes I have seen indicate that one of the police officers who described seeing two suspicious men fleeing the St Vincent Street area on the night of the crime noted their heights as being 5ft 10ins and 5ft 8ins respectively. One was described in the handwritten notes as having a "sallow" complexion.

Apart from the fact that Gair and McLeod are certainly far from "sallow", it is also important to note that both are comfortably over six feet tall. Also of significance is the fact that the handwritten notes this officer made at the time mention the name of someone they had arrested in Glasgow city centre 11 months earlier. This alleged incompatibility in identification evidence will now form additional grounds of appeal at the next hearing for Gair, as will hotly contested forensic evidence disputing whether a knife linked to the case could really have been used to murder Smith. Two of the UK's leading consultant pathologists, Professor Bernard Knight and Dr Albert Hunt, have commented in documents that the knife produced in the original court case couldn't have been the murder weapon.

Although he sometimes sounds spaced-out, Gair can talk in forensic detail about his predicament. He has little else to occupy his mind: "I've got to the point where I get up in the morning, I go to the chemist, I get my methadone, I go to the Salvation Army because it's the only place where I can afford to pay for food - it's 50 pence for a three-course meal - and then I walk back up the road and I sit in the house until the next morning. And that's been my life, apart from living in hostels, and having to deal with the people who live in them - drug addicts, muggers."

His childhood dream, he says, was to be a fighter pilot. Instead he now sits alone and watches the talk show Loose Women every day before barricading himself into his flat at night. He admits to being scared he'll lose his appeal and be thrown back into jail for the murder, despite having served the ten-year minimum tariff already. "They're going to put me back in jail, " he says. "It's too big. I mean, there were at least three police stations involved. It's all right to say you'll keep fighting but I'm 42 at the moment. What am I going to be when I get out? Fifty? I can see the verdict being quashed, but how many years it's going to take, I don't know. I am in a depressed state of mind about this appeal."

When Gair was released on bail in 2000 he was helped by Dr Jim McGregor, an Alloabased GP, and his wife Maureen. Gair stayed with them for six months but, for reasons he won't explain, the arrangement - perhaps inevitably - fell apart. He conveys a sense of sadness about that whole episode: "It didn't work out. I mean, you can't walk into someone else's ready-made middle-class family."

Two subsequent terms in jail for drug offences have followed. Now Gair is trying to reduce his methadone intake by the week.

"I've been out since 2000, and apart from the fact I've not had money I can't have a proper girlfriend because I can't have a proper relationship, " he says. "You need to have a home or house, and I've been living in hostels, and they're really jails and they're also full of drugs.

I've not been out to a nightclub and I've been out of prison for years. I'm on benefits and I have no money." His eyes start to redden and his voice cracks as he explains: "I mean, I've not had a cuddle, which I know sounds a bit pathetic, but I haven't had anyone give me a hug or a cuddle in years. No-one cares. It's been hellish."

He still has his pride, though. As we leave I ask how he got the fresh scars on his head. He mutters an unlikely tale about falling off a bike.

We both find it laughable. When I ask him about other childhood memories, he tells me he used to play the piano: "When I was at school I could have done anything. It was always either me that was first or a girl called Carol. But when I hit first year at high school, that's when I stopped playing the piano. The guys I ran about with were older and were into fighting. I liked Beethoven's Moonlight Sonata, and my music teacher also had me playing Scott Joplin. My ma used to take me in the wee Volkswagen with my case and my music sheets, but my mates laughed at me, so that's what stopped that."

Only then do I notice his tattooed knuckles.

One hand says "LOVE" and the other begins "H" - but the rest of the letters are missing. I could have sworn the full word was spelled out the last time we met. "Nah, you're wrong, " says Gair, mildly rebuking me. "I had it removed a week before my 14th birthday. As soon as I got them I had to get that taken off. Look at the scars: I got the doctor to cut the letters right out of my fingers." Why? "Because I don't hate anybody. I never have."