Jessica McCagh died of her injuries at Ninewells Hospital
A teenager accused of murdering his girlfriend by dousing her in petrol and setting it alight told police that he tried to rescue her from the blaze.
Stewart Blackburn, 18, told officers he "fell down crying" as he tried to pour water over Jessica McCagh.
He also recalled hearing the 17-year-old girl screaming after the bed she was in went on fire.
Mr Blackburn is on trial at the High Court in Livingston. He denies murdering Miss McCagh on 25 April.
The court was shown a recording on Monday of the first interview Mr Blackburn gave to Tayside Police in the aftermath of the fire.
The accused told officers that Miss McCagh had been in bed at the flat they shared in Bloomfield Road, Arbroath, and had been "moaning" at him about his motorbike.
He said his motorbike petrol tank was sitting on the bed, while a jerry can which was also on the bed was "lying down on the lid".
"She was going mental saying it was smelling of petrol," he told the officers, and said he had then lit a "rolly" cigarette.
"Soon as I lit it my whole wall just went 'pfff' right round the whole bed and I couldn't get at her," Mr Blackburn told the police.
"The whole bed went up and I could just hear her screaming."
The jury heard he told officers he then ran though to the kitchen, where he grabbed a pot to fill with water.
He said: "I just seen her walking through, totally melting away and I totally fell down crying, just trying to get as much water on her as I can."
Mr Blackburn also told the officers he was trying to get Miss McCagh away from the scene when his neighbour appeared.
He said: "My legs went on fire but I still tried to get her out."
The accused said he and a neighbour were eventually able to get Miss McCagh out of the flat.
The trial, before Lord Bracadale continues.