Gardaí followed a trail of blood to the spot where a man was viciously attacked and stabbed by a gang of youths, a court has heard.
Karl Harford (23) and Tony Dempsey (20) pleaded guilty to committing violent disorder at the Basin Street flat complex, Dublin 8 on July 11 last year.
Both men had been on bail at the time for other offences.
Harford was sentenced at Dublin Circuit Criminal Court to five years with the final 2.5 years suspended, while Dempsey got a three-year sentence with the final year suspended.
Harford, with an address at Dolphin House, Rialto, and Dempsey, of New Road, Inchicore, were sentenced today for this and a string of other violent offences.
A third accused, Eddie Dempsey (24), of New Road, Inchicore, has already been sentenced to two years in prison for violent disorder, after the court heard he had played a lesser part in the assault.
A fourth accused is due to be arraigned tomorrow for his role in the same offence.
Judge Mary Ellen Ring said Harford's real problem seemed to be his difficulty controlling his temper. She also noted that he was at a high risk of re-offending.
The court heard that Harford has 149 previous convictions and had been on bail at the time as part of an eight-year sentence after he was caught with a petrol bomb.
His five-year sentence imposed today will begin when his current eight-year sentence is served.
Tony Dempsey, who has 43 previous convictions, had also been on bail for a separate offence.
Garda Kevin Lawless said the victim, Karl Gavin, had been on his way to visit his sister when he was “viciously assaulted” by a gang of youths.
They beat Mr Gavin up with their fists, then with a crutch. He was also stabbed with a knife twice in the back.
Gardaí were called to the scene and followed a trail of blood from the ambulance treating Mr Gavin to where he was assaulted in the Basin Street flat complex.
Mr Gavin was hospitalised for his injuries. He was reluctant to make a statement to gardaí, but did confirm he had been stabbed.
He did not wish to provide a victim impact statement.
Harford's 149 previous convictions include 77 for road traffic offences and others for assault, misuse of drugs, criminal damage, violent disorder, possession of knives and public order offences.
Tony Dempsey's 49 previous convictions, include 22 for road traffic offences and others for theft, misuse of drugs, criminal damage and possession of knives and firearms.
Separately, Tony Dempsey was sentenced to two years in prison for possessing stolen property, including an axe, on August 7, 2013.
Garda Mark Twomey said Dempsey was spotted hiding under a hedge at Wainsford Manor Crescent, Terenure, Co Dublin holding an axe which he had stolen from a nearby house.
He was also carrying stolen house and car keys from the house, and other items including a stolen screwdriver and silver necklace.
Dempsey was arrested and admitted the offence.
His two-year sentence was backdated to July 1, 2014 and will run concurrently to the three-year sentence above.
Harford was sentenced separately to five weeks in prison for breaching the peace at the Criminal Courts of Justice, Parkgate Street, on September 4, 2013.
Sergeant John White told the court that two groups of men were seen shouting and posturing aggressively at each other in the Great Hall of the building.
One man launched a flying kick at the other group but made no contact, whereupon gardaí intervened and took out pepper spray.
Harford continued to be aggressive, pushing and shouting at gardaí while they tried to restrain him.
Two other co-accused men were given five-week sentences.
Pieter Le Vert BL, defending, said Harford was an extremely intelligent young man and although he had problems in the past with tablets and drink, has since managed to put those struggles behind him.
The court heard Harford had worked as a roofer and intends to complete his Leaving Cert while in custody.
Mr Le Vert said Tony Dempsey had an “horrifically chaotic” upbringing, during which he was placed in care ten times in ten years.
Dempsey's father is currently in custody in Cloverhill Prison.
Judge Ring ordered both Harford and Dempsey to keep the peace and be of good behaviour for the suspended portions of both of their sentences.