Two teenagers were "ferociously" stabbed to death by rival gang members who "invaded" a party, a court heard.
Dom Ansah and Ben Gillham-Rice, both 17, were knifed by masked attackers at the birthday party in Milton Keynes on 19 October 2019.
Luton Crown Court heard they suffered multiple injuries as armed raiders "stormed" the property.
Four defendants deny two counts of murder while a fifth changed his plea at the start of the trial on Monday.
Earl Bevans, 23, also admitted two counts of wounding with intent.
The other defendants have all entered not guilty pleas.
Jurors heard the accused were all connected to the B3 gang based in west Bletchley, Milton Keynes.
After a tip-off that people associated with rival M4 group were at the house party, they went to Archford Croft, prosecutor Charlotte Newell QC said.
Wearing masks and carrying weapons, they stormed the rear of the house while one intruder, armed with a large machete or "Rambo" knife, blocked the escape route at the front door, the court heard.
Ben Gillham-Rice was stabbed six times, including through the heart, causing him to die almost immediately, the prosecutor said.
His friend Dom Ansah was chased out on to the street but slipped, and was "repeatedly sliced and stabbed as he lay on the ground," said Ms Newell.
He sustained 47 injuries and died later in hospital.
"The attack upon them was immediate and ferocious," said Ms Newell.
Two other people were seriously injured in the attack.
Ms Newell said two particular incidents may have "served to act as a catalyst" and motive for the events of 19 October.
One involved one of the defendants being assaulted, stripped and taunted in woodland in the Westcroft area of Milton Keynes in 2017.
This was recorded and shared on social media, the court heard, and the teenager later named Dom Ansah as one of the perpetrators.
Charlie Chandler, 22, and Clayton Barker, 20 both from Bletchley, along with two teenagers aged 17 and 16 who cannot be named because of their ages, deny murder.
All four further deny two charges of wounding with intent in relation the the two other teenagers injured at the party.
Bevans will be sentenced after the trial, due to last seven weeks, concludes.