Jordan Monaghan, 30, is accused of killing Evie Adams, 23, with tramadol and diazepam in October 2019 and accused of murdering his two young children by smothering them in 2013.
Mr Monaghan had told detectives he did not make calls or send messages from his phone to buy any drugs.
But on Monday (November 29) he admitted to the jury at Preston Crown Court that he lied to police, although he denied it was anything to do with his partner Evie Adams and said the drugs were for himself.
The court heard call records gathered by detectives showing a series of WhatsApp, Snapchat or phone text messages from the phone used by Mr Monaghan on the day, and in the days leading up to, the death of Ms Adams.
Mr Monaghan told police that contact with two other men, Tom Bank and Ben Grundy, was to do with work or planning a Halloween party.
During police interviews, he claimed someone else may have been using his online profile or phone to make calls and texts to buy drugs.
Monaghan told police that contact with two other men, Tom Bank and Ben Grundy, was to do with work or planning a Halloween party.
Monaghan had denied he made any calls to do with drugs, during police interviews after his arrest, claiming someone else may have been using his online profile or phone.
Ben Myers QC, defending, asked Monaghan why he did not tell the truth until now.
The defendant replied: "Because the police were out to get me in my view, so I didn't want to admit buying drugs, so I lied.
"Because it was hard to get out of the lie. But eventually I knew I had to tell the truth."
Monaghan admitted he joined a WhatsApp group titled UK Tablets, and sent a message to buy drugs, saying "Who's got Tramadol?" and asking others for "Pregabs and blues" meaning diazepam and pregabalin, an anti-anxiety medication.
Mr Myers asked the defendant: "When you got drugs, did that have anything to do with Evie Adams?"
"No. Never," Monaghan replied.
The digger driver denies the murder of his daughter Ruby, aged 24 days, on New Year’s Day 2013, and his son Logan, aged 21 months, eight months later, while living with the children's mother, Laura Gray, 28.
He allegedly smothered both.
On the night Miss Adams died at the house they shared in Hazel Close, Blackburn, Lancashire, Monaghan travelled to the Wigan area, he told officers, to look at a drainage job at a gym.
The prosecution say Monaghan was deliberately distancing himself from Miss Adams as she lay dying.
Shortly after he returned, an ambulance was called to Hazel Close after Miss Adams was found collapsed on the bedroom floor.
Despite emergency resuscitation attempts by paramedics she was declared dead at 8.50pm.
Monaghan, of Belgrave Close, Blackburn, denies three counts of murder, two counts of attempted murder and two counts of cruelty to a third child, who cannot be identified, all between January 1, 2013 and October 24, 2019.
The trial continues.
It is thanks to our loyal readers that we can continue to provide the trusted news, analysis and insight that matters to you.
For unlimited access to our unrivalled local reporting, you can take out a subscription HERE and help support the work of our dedicated team of reporters.