Police in Pennsylvania arrested a man Saturday after he broke into a home and attacked his co-worker with a machete in a jealous rage.

Shannon Spory, 20, of Stoystown, Pennsylvania, has been charged with two counts of attempted homicide and one count each of aggravated assault, burglary, terroristic threats, possession of a weapon, simple assault and reckless endangerment, according to court documents.

Authorities say the incident took place because Spory was jealous of his co-worker's friendship with his ex-girlfriend.

The victim sustained "multiple lacerations to his hands, arms, chest, face, head and back," and Spory also suffered injuries. He told police that he entered his co-worker's home around 5 a.m. and contemplated whether or not he should follow through with his plan, while standing next to the man's bed as he slept.

Spory allegedly said, he "decided that he wanted to follow through on his plan to kill" his co-worker and brought the machete down on the man’s head. The man then woke up and a scuffle for the machete took place.

State Trooper Joseph Kozuch wrote in an affidavit that Spory was stabbed several times and injured his own hand.

After several minutes, Spory said he was "becoming progressively tired," and told his co-worker he would surrender.

Later that morning, Kozuch interviewed Spory at hospital UPMC Somerset.

"He related that he is an extremely jealous person," Kozuch said, according to the Tribune Democrat, a publication based in Johnstown, Pennsylvania.

"He related that, since his breakup with his ex-girlfriend, he has become increasingly jealous of the victim and his ex-girlfriend’s friendship. He related that he decided about a week ago that he was going to eliminate the victim from the picture. … He related several times that his intention for going to (the victim’s) house was to kill him."

crime scene
Representational image Getty Images/Jonathan Alcorn