A man in crutches slashed a friend after fearing he was going to be attacked.
Kenneth Sparling struck Maxwell Tennie with a weapon described by a judge as “fearsome”.
The 45 year-old used a baton with a blade inside when he launched the savage attack at his home in Methil, Fife on July 13.
Sparling, who had been involved in a serious road traffic accident the previous year, lashed out after Mr Tennie and another man had turned up at the house.
Police also discovered a stun gun when called to the scene.
‘He has done my artery’
Ex-farm worker Sparling was jailed for a total of seven years and 10 months at the High Court in Glasgow.
He was originally charged with attempted murder.
He pled guilty to attacking Mr Tennie to his severe injury, permanent disfigurement and danger of life.
Sparling further admitted possession of the stun gun.
Prosecutor Euan Cameron told how Mr Tennie had been “annoyed” by his friend Sparling.
He stormed to his home and initially tried to goad Sparling into chucking a pot of pasta he was clutching.
There was a row before a man with Mr Tennie, not identified in the court, attempted to usher him out.
Sparling eventually grabbed the cosh-type weapon, which extended into a sword.
He hit Mr Tennie on the head, before stabbing him in the legs.
A bleeding Mr Tennie screamed: “He has done my artery.
“The b***** has done me in the artery.”
Sparling then went to a neighbour’s home and admitted he had attacked his friend and that it was “bad”.
‘This was a fearsome weapon’
He was later arrested and police discovered the stun gun, which was said to have been left by an associate.
Mr Tennie needed surgery at hospital. Medics said the injuries had a potential to have killed him.
Kris Gilmartin, defending, said Sparling had been concerned when Mr Tennie turned up that day.
The lawyer added: “He accepts that he could and should have contacted police but he did not.
“He was angry, as well as scared, that violence was going to be visited upon him.”
Sparling appeared in the dock on Wednesday still in crutches.
Sentencing, Lady Stacey said he was fortunate not to be facing more serious charges.
She went on: “This was a fearsome weapon – a cosh with a knife inside.
“You also had in your house a stun gun.
“Even if Maxwell Tennie started it, that does not excuse what you did.”