A man accused of murdering his girlfriend's six-week-old baby girl admitted shaking her when she went to hospital, a trial has heard.
Mark Simpson, 29, denies murdering Alexis Matheson by assaulting her in Aberdeen's Deansloch Crescent between 8 November and 9 December 2007.
He allegedly seized hold of her, shook her and compressed her chest, leaving her so severely injured that she died.
Mr Simpson has gone on trial at the High Court in Aberdeen.
The baby's grandmother Violet Hocking, 64, told the first day of the trial her daughter Ilona, the child's mother, moved in with Mr Simpson shortly after the baby's birth.
The court heard how Mr Simpson and her older sister, Amanda, were also expecting a baby at the time but had recently separated.
The jury was also told Alexis's mother moved into Mr Simpson's Northfield house about two or three weeks after she was born on 26 October.
Mrs Hocking said the baby had been healthy and there were no problems during her birth at Aberdeen Maternity Hospital.
She described her daughter as a good mother who took care of her newborn baby.
Advocate depute Ian McSporran, prosecuting, asked: "How was she with the baby?"
She replied: "Very good. I was very proud of her."
Asked how the baby was, she said: "She wasn't very good at settling down but not any worse than any baby would be. She was quite alert."
Mrs Hocking said Mr Simpson admitted shaking her grandchild after she was admitted to hospital on 9 December.
She told the court Mr Simpson's mother had given her a lift to Aberdeen Royal Infirmary and they arrived to find her daughter Ilona in a "terrible state".
Mr McSporran asked: "Did you see Mark when you got to the hospital?"
She replied: "Yes, he was sitting with Ilona. He was quite anxious."
She said Mr Simpson claimed to have carried out CPR on the young baby.
She added: "He kept saying 'I hope I've done enough. I hope I did enough to bring her round'."
Mr McSporran asked: "Can you remember him saying that he had tried to resuscitate the baby?"
Mrs Hocking replied: "Yes, he was just saying this more or less to his mother. He mentioned that he had given the baby a shake to try to get a response from her."
Mrs Hocking said Alexis was transferred to hospital in Edinburgh, but her life support machine was switched off the following day.
She told the court: "We were taken into this room where the baby was and we were told there was nothing they could do for her."
The case, which is scheduled to last several weeks, continues on Wednesday.