Daniel Boulton, 30, is on trial accused of murdering his former girlfriend Bethany Vincent and nine-year-old Darren Henson.
Boulton denies murder but admitted charges of unlawfully killing Ms Vincent and her son, known to his family as DJ, on the second day of his trial at Lincoln Crown Court.
He also entered a guilty plea to assaulting PC Stephen Dennis with intent to resist arrest the day after the killings and burgling an empty cottage at Hubbards Hill, Louth.
Mr Justice Pepperall told the jury Boulton now accepts causing the unlawful deaths of Miss Vincent and Darren Henson and the issue they now have to decide is if he is guilty of murder.
The jury heard Ms Vincent had a restraining order against Boulton at the time of her death.
Prosecutors said Boulton admits the stabbing but says he was suffering from a mental health condition.
Opening the trial at Lincoln Crown Court, prosecutor Katherine Goddard QC said Boulton’s relationship with Ms Vincent began in March 2019 but he had become increasingly violent towards her and her family.
The court heard that following a complaint to police in November 2019 Boulton was ordered not to contact her but “repeatedly broke it”.
The weekend before the attack Boulton had sent nearly 900 messages to Ms Vincent on Facebook.
Ms Goddard said Boulton had also developed a “hatred” for Darren - also known as DJ - who had autism. He was also said to have threatened to “wipe out the blood line of her family”.
On 31 May, the day of the attack, she said he walked 28 miles from his home in Skegness to Ms Vincent’s home in High Holme Road where he repeatedly stabbed her and Darren.
When police arrived at the property they found Ms Vincent in the front room and Darren lying on the floor in his bedroom.
Ms Goddard said both had been stabbed and there were also “marks consistent with blunt force trauma”.
The court heard Ms Vincent and her son had been due to move to an address unknown to Boulton just a few days later.
Ms Goddard said that officers also found a nine-month old baby crawling around the house “untouched and unharmed but clearly distressed”.
Jurors heard that after the attack Boulton had spent the night on the run.
Ms Goddard said at one stage he broke into an empty cottage at Hubbards Hills, on the outskirts of Louth, where he stole some alcohol, clothing and food and left a note saying “I, Daniel Boulton, take full responsibility”.
The next day he assaulted off-duty police officer PC Stephen Dennis who was walking his dog near Hubbards Hill, Louth, and tried to detain him before fleeing again.
Boulton was later cornered in a barn and tasered after trying to get some of the armed officers to shoot him, the court heard.
Ms Goddard told the jury there is “no dispute” he stabbed both victims, but that he claims he was “suffering from a recognised mental condition which substantially impaired his ability to form a rational judgement and exercise self-control”.
Boulton, of Alexandra Road, Skegness, denies murdering Ms Vincent and her son.
The trial continues.