An East Kilbride man claimed he armed himself with an ornamental sword after a neighbour attacked him twice.
Robert Dobbie went outside with the weapon and was joined by Iain McKendrick who had a knife.
The pair were arrested when another neighbour called the police, Hamilton Sheriff Court heard this week.
Dobbie, 45, of Trinidad Way, admitted carrying a sword in public while McKendrick, 38, of Main Street, Blantyre, admitted illegal possession of a kitchen knife.
Dobbie was also charged with shouting abuse, making threats, brandishing the sword at another man and fighting with him, but his not guilty plea was accepted.
The court heard police were called to Trinidad Way around 6am on June 5 last year.
Aga Mathieson, prosecuting, said: "Both accused were in Dobbie's home. They had been drinking throughout the night.
"Both were intoxicated and a neighbour contacted the police.
"Officers checked CCTV and observed the men in the close with weapons."
Defence agent Andy Thomson said Dobbie had mixed alcohol with his medication.
The solicitor stated: "He and others were having difficulties with a neighbour. My client was assaulted twice and photographs show an injury to his face.
"He went back to his flat where he had an ornamental sword before going out again. It seems there was then another confrontation and the police were called."
Ian Scott, defending McKendrick, said his client picked up a knife when he saw his friend with "a very obvious injury" and a crowd of people outside the flat.
Mr Scott added: "It's very regrettable that this developed."
Dobbie has been in prison before but Sheriff Linda Nicolson was "just persuaded" by his lawyer to allow him a community-based sentence this time.
He will be under social work supervision for a year and must carry out 300 hours of unpaid work.
Dobbie will also be confined to his home between 7pm and 7am each day under a three-month electronic tagging order.
McKendrick was ordered to do 180 hours of unpaid work.
And did you know Lanarkshire Live is on Facebook? Why not head to our page and give us a like and share.
*Don't miss t he latest headlines from around Lanarkshire. Sign up to our newsletters here .