Judge Gemma Loughran told Co Fermanagh man Neill William Dixon, 28 and from Whinnigan Glebe in Lisbellaw, that he would have been jailed for a year - instead of having that one-year sentence suspended for three years - if it hadn't been for the exceptional circumstances of his case.
Dungannon Crown Court heard that the father-of-one, who pleaded guilty to possessing a firearm with intent to cause fear of violence or injury, let off his legally held shotgun last February, to scare off a friend - fearing he was going to tell of his affair with his wife.
Judge Loughran said the exceptional circumstances in Dixon's case included his guilty plea, his "deep shame and regret", and the fact at the time he was "under considerable strain".
However, she did add that the strain was "very largely" of Dixon's own making, as he had "chosen to engage in a relationship with another man's wife".
Earlier, the judge said Dixon's desire was to keep his extra-marital affair from his own wife in an effort to "preserve his own marriage and family life".
She added that his behaviour was "utterly disgraceful", having acted as he did "out of self-interest".
Judge Loughran accepted that Dixon had intended only "to frighten" his victim, rather than to harm him.
In all of the circumstances, and not without some hesitation, I think it would be appropriate to suspend that sentence.
Judge Gemma Loughran
The judge added that, while she had no power concerning the firearms licence Dixon has held for the past nine years, she would recommend that "never again" should he be permitted to hold such a licence.
Prosecution lawyer Suzanne Gallagher, reading from a set of 'agreed facts', told the court that Dixon's victim - a family friend - had gone to his home "with regards to inappropriate text messages which had been exchanged between the defendant and the injured party's wife".
Having failed to make contact with him, after being wrongly told Dixon was at his parents' home, adjacent to his own, he parked at the entrance of their laneway and tried calling Dixon again, but to no avail.
"He was sat there for a couple of minutes when he noticed the outside light at the defendant's property coming on," Ms Gallagher said.
"He could see two shadows walking past the front of the defendant's home."
Ms Gallagher said the man lost sight of the men but, on turning his Jeep round, and seeing both Dixon and his brother in the headlights, he put the vehicle in gear, driving slowly towards them.
"He stated the defendant was walking with both arms down by his side as if he was carrying something behind him. He then saw the defendant's arms come up in the air as high as his stomach," she said.
Ms Gallagher added that, seconds after driving off at speed, "he heard another loud bang".
It looked like he was aiming something in the air. He (The victim) couldn't make out what it was, but heard a crack and realised it was the sound of a gun going off.
Suzanne Gallagher, prosecution
When later interviewed, Dixon initially "indicated that there had been inappropriate text messages between himself and the injured party's wife".
The court heard that, in further interviews, he accepted that there had been an affair between him and the injured party's wife and that eventually he used his firearm to scare the injured party away, as he didn't want him going to his house and his own wife finding out all about the affair.
Defence lawyer Ian Turkington revealed that since the unfortunate incident, Dixon, who attended court with his wife and father, "had endeavoured to repair things" between the former friends - so that they could "get on with their lives".
He said he had been instructed "from the outset" to apologise, not only to the court, but in particular to the injured party and to express Dixon's "deep shame and regret".
He added that in addition to Dixon expressing his remorse at "each and every turn", he had also indicated his awareness and insight into his wrongdoing.
Mr Turkington argued, while it was accepted that the custody threshold had been crossed, it was an exceptional case and - given his guilty plea and that, in line with several other similar cases where firearms had been discharged - any such sentence could be suspended.