It was one of three separate violent incidents across the city over the weekend.
One teen required surgery after being stabbed in one of his kidneys and his friend received several stitches to head wounds after he was being beaten about the head with what gardaí believe was either a metal bar or a baseball bat.
The incident occurred in the Wilton area of the city around tea-time on Saturday.
The two teenagers, aged 15 and 16, left Wilton Shopping Centre at around 6pm and were walking through the nearby Wilton Court housing estate when they were met by a gang of between 20 to 30 young people, also believed to be teenagers.
A knife and what is believed to have been either a metal bar or a baseball bat were produced.
One of the victims suffered at least one stab wound in the side, with the blade puncturing one of his kidneys.
The other suffered several cuts after being beaten about the head by a bat or bar.
A garda spokesperson said: “The two victims were completely innocent in all of this. There was no apparent reason for this attack. These two boys just happened to walk straight into this gang. They just happened to be in the wrong place at the wrong time.”
The gang members fled before the two injured friends managed to make their way to a friend’s house nearby.
They were driven by an adult to Cork University Hospital, less than three minutes away, where they received medical treatment and gardaí were alerted.
Supt Charlie Barry said this was a particularly worrying incident given that the two teenagers were the victims of a violent and unprovoked attack by a gang which was roaming through suburban housing estates armed at least with a knife and possibly a baseball bat.
Detectives are examining CCTV footage and gardaí have appealed to anyone who saw members of this gang in the Wilton, Sarsfield Rd, Doughcloyne, or Togher areas between 5pm and 7pm on Saturday to contact gardaí at either Togher Garda Station on 021-494 7120 or Bishopstown Garda Station on 021-462 4500, or any garda station.
Meanwhile, two men were being questioned by gardaí last night investigating an alleged assault on another man during a suspected hijacking at Rathcooney Cemetery on the northside of the city.
The victim, believed to be in his 60s, was injured when two men tried to drag him from his car.
He was removed by ambulance to Cork University Hospital for treatment.
Gardaí later arrested two men, aged 18 and 20, who were yesterday being held at Mayfield Garda Station for questioning in connection with the incident.
Separately, gardaí are searching for two youths after a man in his 60s was battered with a hammer outside his home in Meelick Park in Ballyvolane on Saturday after he interrupted at least two teenagers as they interfered with his car.
One of his daughters was threatened with being stabbed during the incident.