A Charlottetown man was sentenced Friday to two years in prison for a pair of vicious attacks.

This past July, Mathieu Terrence Myers entered a woman's apartment and stabbed a man who was with her.

In a separate incident, while serving time on another charge, he knocked a fellow inmate unconscious by repeatedly kicking him in the head.

The 27-year-old Myers was scheduled to go on trial Friday, but instead changed his plea to guilty on one count of aggravated assault and one count of assault causing bodily harm.

The stabbing took place in an apartment on Bayfield Street in Charlottetown. Myers' former girlfriend lived there. She was at home watching videos with another man when Myers forced his way in.

Judge John Douglas in provincial court heard Myers stabbed the man three times with a pocketknife, inflicting inch-deep wounds in the man's shoulder, thigh and back. He also bit the man's forearm hard enough to draw blood.

The victim ran, bleeding, from the apartment, and called 911.

A couple of hours after the attack, Myers sent a text message to his victim, threatening to kill him if he called police.

Fellow inmate beaten

The jailhouse attack happened a year ago, in November 2012, while Myers was serving a sentence for a previous assault.

Court heard he attacked a prisoner who was lying on the floor of their shared cell, doing a crossword puzzle. Security video shows Myers kicking the man in the head even after he had lost consciousness.

Myers left the man bleeding from the ears and nose, with an imprint of a shoe on the side of his face.

He will serve his two years in a federal penitentiary.

Myers still has one more charge to face, of threatening to kill guards at the jail.