The boyfriend of Jodi Jones was seen near the Dalkeith woods where her body was found looking as though he had been "up to no good", a court has heard.
Jodi Jones was 14 when she was killed in June 2003
Witness Lorraine Fleming, 46, described how she had seen a youth with a hair-style like rock star Liam Gallagher standing staring at the ground.
Mrs Fleming then went on to identify the person as Luke Mitchell by looking towards him in the dock on Wednesday.
The 16-year-old denies murdering the 14-year-old in June last year.
Luke Mitchell has lodged two special defences, one of alibi and one of incrimination.
Mrs Fleming told the High Court in Edinburgh she saw someone in the street near to where Jodi's body was found as she was being driven home by her partner's sister, Rosemary Walsh .
She said: "He was facing me. As he came into view I turned round and said to Rosemary: 'He looks as if he has been up to no good.'
"It was just the way he was standing. He wasn't looking as if he was waiting on anyone.
"You actually had to see him to know what I mean.
"He was watching the pavement but, as we were approaching he actually flicked his hair back off his face and that is when I realised it was a young boy."
Mrs Fleming described him as looking about 17 years old and dressed in dark clothing, apart from his jacket, which was dark green.
When she heard about Jodi's killing the following day she decided to contact the police.
In a statement, she likened the youth to a newspaper photo she had seen of Oasis singer Mr Gallagher, pointing out their similar hairstyles.
In court, Mrs Fleming was shown a newspaper report of Jodi's boyfriend being questioned by police, accompanied by his photograph.
The witness said the picture was of the teenager she had seen on the day of Jodi's murder, before indicating it was the accused in the court.
Questioned by Donald Findlay QC, defending Luke Mitchell, Mrs Fleming said the youth was doing nothing but standing against the gate.
The trial is taking place at the High Court in Edinburgh
She agreed he was bothering no-one and not blocking the pavement.
The lawyer asked her: "He was doing nothing that was in any way wrong, menacing, threatening or distressing, is that correct?"
Mrs Fleming replied: "Yes."
But she added: "It just didn't look right. I am sorry but it didn't."
During long questioning from Mr Findlay, Mrs Fleming broke down as he quizzed her about newspaper photographs she claimed to remember.
Mrs Fleming had told police one photo of the accused, which appeared on 15 August "showed more of his face and his eyes" than a picture she said she had seen earlier which reminded her of the youth she spotted.
The lawyer said a search of Scottish newspapers had come up with no picture of Luke Mitchell before that date.
Mrs Fleming told her questioner: "You are just confusing me.
"All I can do is tell you what I saw and that is what I am doing."
Mr Findlay said: "Those are not the pictures at all which triggered your memory.
"The picture which triggered your memory is one we have not yet seen in this court. You might not like it but it has to be right."
He said whatever the picture was, it could not have been Luke Mitchell.
He added: "What it does demonstrate, does it not, is that people, however genuine, however honest, however hard they are trying, people can sometimes make mistakes which can have very serious consequences."
"Yes," agreed Mrs Fleming.
It is alleged that Luke Mitchell applied a ligature around Jodi's arms and struck her repeatedly on the head, mouth and body with a knife.
He is also accused of the unlawful possession of a knife or knives in public places, including St David's High School, and of being concerned in the supply of cannabis resin to a number of people, including Jodi.
The teenager denies all three charges.
The case continues.