Prosecutor Louise Blackwell, QC, told the court: "On January 14 the defendant had been at work at Benjamin House.
"She had gone home that evening and then in the bathroom she had given birth to Mia Kelly. There, Mia Kelly met her death."
The court was also told that Tunstill had suffered a miscarriage in March last year.
The prosecution alleged that the miscarriage was a result of Tunstill wanting to climb the career ladder: being pregnant would scupper her ambitious plans.
Blackwell told the court: "Her iPad and mobile phone were seized and internet searches were found, which included the phrase 'bringing about abortion'."
Police became involved with Mia's death when Tunstill went to Burnley General Hospital after feeling "the miscarriage was not complete" on January 16 this year.
Tunstill, who denies murder, was questioned when Kelly was arrested for murder - the first he knew about the grim discovery.
The jury was told examinations later showed an "abnormal growth", which the defendant felt was the umbilical chord still attached to the placenta.
Blackwell said: 'Tunstill told nurses that she had passed a baby and it had not been breathing.
"It had turned blue and she couldn't find a pulse. She placed the baby on the floor, while she sorted herself out. Then she bagged up the baby and placed it in the bin."
Tunstill claimed she was only five weeks' pregnant - but more intrusive examinations suggested she had been pregnant for between 36 and 37 weeks.
The court heard Tunstill had told Kelly she had also miscarried in March last year before telling him that she had fallen pregnant again in December after herbal tea had interfered with the morning after pill.
On January 14, the jury heard Tunstill told Kelly, a forklift driver, that "it was happening again" as the baby dropped into the basin of the toilet.
Tunstill told police she had not flushed baby Mia "as she had done with her previous miscarriage" - but held the baby to her face to see if she was still breathing.
Blackwell said the defendant also told police the baby had a small cut to the back of its neck but offered no explanation as to how it got there.
Once baby Mia was dead, Tunstill wrapped her body in two plastic bags, walked past Kelly playing on his games console, and placed the body in the bin.
Defence counsel Simon Kealey said: "There is no dispute that the baby was born alive and that the baby died as a result of a number of stab wounds.
"But the precise process by which that occurred the defendant has no recollection of."
Kelly admitted his attention was focused on the Xbox game The Walking Dead.
The only noise Kelly said he heard coming from the bathroom was a sound "like squeezing water out of a plastic bottle".
At some stage his girlfriend, a mental healthcare boss in the town, asked him for a pair of scissors, which he passed to her through the doorway and she replied: "Thanks babe."
He agreed he was "engrossed" in playing The Walking Dead, which featured zombie sounds, screams and shouts, he said - while she was unwell with stomach pains and was later sick on the carpet.
Kelly denied she was crying out in the pain in the bathroom and said he only heard her call out for a pair of scissors.
He said he later saw blood around her waist, on towels and on the floor after she came out of the bathroom.
Kelly said he checked on her two, maybe three, times, and explained: "She kept telling me she was fine so I took her at her word. I thought she had dealt with a miscarriage before so she was equipped to deal with another one."
After she had cleaned herself up and the bathroom, the couple cuddled in bed and she fell asleep, he told the court.
Kelly said some of the video games he played were "quite violent".
Kealey asked: "Video games that might involve you holding some kind of a weapon as part of the on-screen action?"
"Yes," the witness replied.
Blackwell asked Kelly: "Do you know how long a pregnancy is?"
Kelly said: "Nine months."
She went on: "Did you have any knowledge of what happens during a miscarriage?' He replied: "No idea."
Blackwell added: "Did you understand anything other than what she told you?"
Kelly said: "No, I didn't."
The witness told the court that, after his daughter's death, he was "surprised" to learn that Tunstill had been diagnosed with Asperger's syndrome as a child.
The prosecution say that Tunstill only informed a few people about her pregnancy late last year and said she was in the early stages.
Consequently, she had not been to hospital or sought any medical advice or assistance with the pregnancy, it is said.
Tunstill eventually went to Burnley General Hospital on the morning of January 16 where she told staff she was nine weeks' pregnant, had suffered bleeding and was concerned she had had a miscarriage.
Medics found that part of the umbilical cord was still attached to the uterus, the court had heard.
Police were called to the hospital and officers later found the body of Mia Kelly in the kitchen bin at the flat.
Tunstill's barrister has told jurors it is not disputed the baby was born alive and died as result of a number of stab wounds, but the defendant had no recollection of the precise process of how that happened.
Tunstill denies murder. The trial continues.