BBC One soap EastEnders breached TV regulations in an episode showing a gang attack on the Queen Vic pub, Ofcom has ruled.
Ofcom received 78 complaints over the problem
The media regulator said the soap showed "sustained violence, intimidation and menace" inappropriate for a pre-watershed audience.
The episode also showed a pregnant woman going into premature labour after being knocked over during a fight.
Ofcom received 78 complaints over the episode, broadcast in November 2007.
Ofcom ruled the episode breached guidelines on pre-watershed violence and on the protection of children from inappropriate scheduling.
"The violent content and its duration exceeded many viewers' expectations for a drama which is transmitted an hour and a half before the watershed on BBC One when children are likely to be viewing," it said.
"Although EastEnders is not made specifically for children, it does attract a significant child audience and any portrayal of violence needs to be carefully considered with this in mind."
In its response, the BBC said there had been a gradual build-up to this menacing storyline over several episodes and that it warned viewers of the content of the programme in an announcement before the episode aired.
However Ofcom said that the warning was inadequate and ruled "providing this information does not, in itself, relieve broadcasters of a duty to ensure that material is appropriately scheduled".
In a separate ruling, Ofcom found Sarah Kennedy's morning show on BBC Radio 2 not in breach of regulations after Kennedy made a comment saying that she had almost run over a black pedestrian because she could not see him in the dark.
Ofcom noted Radio 2's public apology over the comments made in October 2007, but added it was "concerned that such a comment with its potential to cause offence had been included in a live broadcast without due consideration for the way it may have been interpreted by listeners".
Actor Joe Swash is to leave EastEnders, the BBC has confirmed.
The 26-year-old, who plays Mickey Miller, will be written out of the programme in a "big, dramatic storyline" to be shown this summer.
David Spinx, 57, who plays Swash's on-screen father Keith Miller, will also be written out of the soap at the same time.
Swash joined the BBC One show in October 2003 before his on-screen family joined the cast a year later.