Roger Weir has been jailed for 18 years for injecting his child with heroin and attempting to murder his ex-partner at her home in Eastleigh.
Weir, 45, shot Gillian Blackmore with a flare gun before beating her with a metal baton and swinging a meat cleaver at her neck.
The incident took place when Weir visited his former partner's flat in Eastleigh, Hampshire on the evening of 7 May, having spent the day looking after their baby.
Winchester Crown Court heard that Weir was angry after hearing that his partner, 27, had begun a new relationship with a police community support officer.
Although he was ostensibly visiting the property to return the baby, Weir soon fell into a heated argument with Blackmore, which culminated in his attack.
Before shooting her, Weir told Blackmore: "I want you dead."
Blackmore managed to flee the property naked and injured, and contacted the police, who found her covered in blood from her wounds.
Weir had stayed in the flat and locked himself in a bedroom with their 20-month-old daughter. When police arrived, he said: "Don't come in here or I'll shoot the baby.
"I can't live with the thought of someone else raising my daughter."
He proceeded to inject the baby with heroin through her mouth. After a police officer talked Weir out of the room, he said: "I have given the baby heroin, I wanted her to die with me ... I wanted her and me dead."
The child had managed to spit it out and was unharmed.
'A dreadful attack'
At the outset of the trial, Weir pleaded guilty to attempted murder and the administration of a noxious substance to the child.
The court heard Weir had suffered from depression for years and had previously spoken of killing himself. He had also self-harmed.
Martyn Booth, from the Crown Prosecution Service, said: "This was an extreme case of domestic violence.
"Ms Blackmore has been the victim of a dreadful attack that night.
"We hope that Ms Blackmore and her daughter will now be able to move on with their lives and that this conviction will bring some kind of comfort to them."