A "bad taste" joke made by comedian Frankie Boyle on Mock The Week about the Queen did not breach editorial guidelines, the BBC Trust found today.
The Trust's Editorial Standards Committee (ESC) found that, while the joke had sexist and ageist overtones, it did not fall foul of the rules.
A repeat of the show was broadcast in October last year - just after the Sachsgate scandal sparked by Jonathan Ross and Russell Brand erupted.
Boyle joked that you would not hear the Queen say during her Christmas broadcast: "I'm now so old that my p**** is haunted."
One viewer complained: "It would have been objectionable at the best of times but coming as it did in the midst of the Ross and Brand controversy it was quite unforgivable."
The committee found that, although it was in poor taste, the gag would not have gone beyond audience expectations.
Richard Tait, BBC Trustee and chair of the ESC, said: "The committee did feel this joke was in bad taste - it had both sexist and ageist overtones.
"However, it was well after the watershed, well signposted and within audience expectations for the show. As a result, this was not a breach."
In a separate ruling, the Trust also found today that "humiliating" jibes made by Boyle about Olympic Gold medallist Rebecca Adlington on the BBC2 show did breach guidelines.
In a show broadcast in August 2008, Boyle said Adlington looks "like someone who's looking at themselves in the back of a spoon".
He also made sexual innuendo, saying Adlington's boyfriend looked like a male model and continuing: "So from that I have deduced that Rebecca Adlington is very dirty - I mean if you just take into account how long she can hold her breath..."
One viewer told the BBC he was "appalled".
The show's producer later responded to the complaint, saying the ribbing might have gone "a tad too far" and apologised.
The Trust's ESC noted that 75 complaints were received about the item, which was originally aired in the week that Team GB returned from the Olympic Games.
It found that, while Adlington was more or less a public figure, in the view of the committee she had not sought celebrity status or courted media attention.
"The committee felt, therefore, that the joke about her appearance and the sexual innuendo were humiliating and there was no demonstration of a clear editorial purpose for the inclusion of these comments."
The committee also noted that the commissioning editor had made her views known about preferring not to include the joke.
It said it was concerned she appeared to have been unable to obtain the edits she would have preferred.
Mr Tait said: "The committee felt that the comments about Rebecca Adlington were humiliating, and this was exacerbated by the fact that she had not sought celebrity status or courted media attention.
"There was no clear editorial purpose for the inclusion of the joke, and the commissioning editor in charge of the programme felt it had gone too far."
The BBC said earlier this month that Boyle had quit Mock The Week after seven series, due to "other television commitments".
A spokesman for the show said Boyle had been "a brilliant member of the team" and the door was always open for him to return.