The BBC has avoided censure after Radio 5 live listeners heard Rage Against the Machine swearing in a live performance of their song Killing In The Name.
Zack de la Rocha, the US band's singer, was heard swearing four times on the station's breakfast show in December.
The band were there to discuss a Facebook campaign to make their song the Christmas number one instead of X Factor winner Joe McElderry's.
Media watchdog Ofcom said the BBC had taken the appropriate measures.
While the song was being faded out, presenter Shelagh Fogarty was heard saying: "Get rid of it."
She then told her audience: "Sorry, we needed to get rid of that because that suddenly turned into something we were not, well we were expecting it and asked them not to do it, but they did it anyway - so buy Joe's record."
Thirty-two listeners complained to the BBC.
The BBC accepted that the language used by the band "was neither appropriate nor justified on a morning programme on Radio 5 live."
Fogarty's apology was repeated by her co-presenter Nicky Campbell later in the show. The editor of the programme issued a further public apology on his blog and a full apology was given to the people who complained.
The live nature of the programme was explained to the band members and their representatives on three separate occasions before the broadcast.
The BBC had asked the band and its management for an assurance that they would change the original lyrics and not use strong language on-air. It said that a specific assurance was given by the band on each occasion.
The corporation said that "in the live interview beforehand, the band members responded to Mr Campbell's questions in a considered and measured manner" and gave no indication that they would not respect their assurances to not swear.
Also, "the first few f-words were in fact changed when the band performed live."
The broadcaster said that while it accepted there was a degree of risk in asking the band to perform live, reasonable steps were taken to minimise this risk.
Ofcom noted that the radio station was aimed at adults and that the broadcast was at 0900 during term-time so children were not likely to be listening.
The watchdog acknowledged that there was editorial justification for having the band on the programme, given the media coverage the chart battle was receiving at the time.
Ofcom also took into account that the apologies made during the programme would have gone some way to mitigating any offence caused by the language used.
But it did criticise the BBC for allowing the band to repeat the offensive lyrics four times before fading the song out, especially given that the producers had full control over the output which was provided over a live feed from the US.
But on balance, Ofcom decided the BBC had dealt with the problem and the case was resolved.