STAMFORD, Conn. — A Connecticut man who was assaulted by three juveniles while at work has been sentenced to serve time in jail for stabbing an attacker.

The Connecticut Post reports 21-year-old Jeffrey Sumpter of Bridgeport was sentenced at a Stamford courthouse on Monday to 18 months in jail.

Sumpter was working at a Dunkin’ Donuts in Norwalk last October when he was jumped by three males. After being assaulted, Sumpter stabbed one of them in the leg.

During the hearing, he said he was defending himself.

Judge John Blawie told Sumpter that he believed his version of events, but had to follow the letter of the law. He was convicted of felony first-degree assault.