Callous James Dempsey,20, assaulted two 14-year-old boys and their 15-year-old friend during a confrontation in Kilwinning, Ayrshire, on December 31 2011.
The High Court in Edinburgh heard that Dempsey struck the one of the youngsters - who cannot be named for legal reasons - on the arm.
He struck the other two boys on the body with the blade.
The court heard that one of Dempsey's victims was so badly injured that he could have died - however, quick thinking medics saved the young man's life.
Dempsey, of 9 Noltmire Road, Ayr, pleaded guilty to three charges of serious assault at a hearing at the High Court in Glasgow last month.
Sentence had been deferred to Friday at the High Court in Edinburgh so that temporary judge Sean Murphy QC could obtain reports about Dempsey's character.
The court also heard that Dempsey had one previous conviction for breach of the peace.
The court heard that following conviction, a sheriff ordered the confiscation of a samurai sword that Dempsey had used in the offence.
Passing sentence, temporary judge Murphy said that he believed that Dempsey posed a significant threat to public safety.
He also ordered that Dempsey be placed on supervision for two years following his release from his time in jail.
Judge Murphy added: "I can only impose one sentence in the circumstances."
Dempsey then wept as he was being led to the cells.