Teenager Jodi Jones smoked cannabis with the teenager accused of murdering her on the day she died, a court has been told.
The court heard that Jodi smoked cannabis with others
Witness Alistair Leitch said he saw Jodi, 14, and boyfriend Luke Mitchell smoking cannabis in a hide-away in a Midlothian wood on 30 June, 2003.
He said they were part of group who met to smoke at school lunchtimes.
Mr Mitchell denies murdering Jodi in Dalkeith and has lodged special defences of alibi and incrimination.
The High Court in Edinburgh was told that Jodi, 14, had been smoking cannabis before she began going out with Mr Mitchell.
The jury heard that Mr Mitchell, Jodi and others would regularly meet at school lunchtimes to smoke in a hide-away known as the Chinese Gardens.
Sixth-year pupil Alistair Leitch, 17, said this took place "pretty much every day".
Mr Leitch said: "Luke rolled joints pretty much every day." He alleged that Mr Mitchell provided the cannabis most of the time.
The witness, now a philosophy student, said that on the day Mr Mitchell has been accused of murdering Jodi, many of the pupils at St David's Roman Catholic High School in Dalkeith were on school trips.
Prosecuting advocate depute Alan Turnbull QC asked him if he remembered what he was doing at lunchtime.
"Yes I went to the Chinese Gardens," replied Mr Leitch.
He replied "yes" when asked separately if he had seen Mr Mitchell and Jodi there.
"What were they doing?" asked Mr Turnbull.
"Smoking cannabis," said Mr Leitch.
Mr Leitch also said he had met Jodi, Parkhead Place, Easthouses, at a house in Dalkeith some months before and she smoked cannabis with him and others there.
Alistair Leitch (pictured) said Mr Mitchell often provided the drug
There was also some "kissing and that" between Mr Leitch and Jodi, which was mentioned in Jodi's diary, the court heard.
Earlier, the jury members were shown the injuries suffered by Jodi.
Trial judge Lord Nimmo Smith first warned the jury of eight women and two men that the images were distressing.
Photographs and video footage showed the teenager's naked body lying in woods with her throat slashed.
Police photographer Alan Murray confirmed to Mr Turnbull that Jodi had "a massive injury to her throat."
He said there were also "cutting, slashing type injuries" to her left breast and abdomen and another open wound on her right cheek.
A wall near the body showed signs of bloodstains, the court heard.
Mr Mitchell has denied murdering Jodi by compressing her neck, and repeatedly striking her with a knife both before and after she died.
He has lodged papers blaming a person or persons unknown for Jodi's murder and said that around the time she was thought to have met her death he was in or near his home in Newbattle Abbey Crescent, Dalkeith.
He has also denied charges of possessing a knife or knives and being concerned in the supply of cannabis resin to Jodi and to other school pupils.
The trial continues.