A 21-year-old man was sentenced Friday to 39 years in prison for repeatedly stabbing his ex-girlfriend, her 75-year-old grandmother and another man after breaking into a home in Northeast Washington in summer 2015.

Ernest Johnson, who is from Baltimore, pleaded guilty in October to three counts of assault with intent to kill for the attacks that occurred in the 1500 block of F Street NE, near the H Street business corridor.

The victims all suffered debilitating and, in two instances, permanent injuries. Johnson will be on five years supervised release when he is freed from prison.

The U.S. attorney’s office for the District said Johnson broke into the residence about 4:30 a.m. on Aug. 15 through a balcony door. He first went to the grandmother’s bedroom, where prosecutors said he tried to strangle her, causing her to lose consciousness, and then stabbed her in the back, head and neck.

Johnson then went to another bedroom, locked the door behind him, and stabbed his 24-year-old ex-girlfriend 28 times in the back, arm, chest and hand. Authorities said he then stabbed her new boyfriend in the head, piercing his skull with the blade.

Two other people who were sleeping in the living room broke through the locked door and stopped the attack by hitting Johnson with a vacuum cleaner. Johnson ran out and was arrested later in Baltimore.

Prosecutors said the grandmother was hospitalized for nine days and could not eat food or drink with her mouth for a week. The man had seizures and suffers from headaches and memory loss. The woman spent nearly two months in the hospital with damage to her spinal cord that left her paralyzed. Prosecutors said she has “regained some motor skills” but “remains significantly impaired.”