Channel 4 breached broadcasting guidelines with jokes about Katie Price's son Harvey on its Frankie Boyle comedy show, the media regulator has ruled.

Ofcom received hundreds of complaints about the comments aired on the controversial series Tramadol Nights.

Boyle said that Price married cage-fighter Alex Reid because she needed someone strong enough to protect her from her son's sexual advances. He also joked that Price and her ex-husband Peter Andre didn't want to keep Price's son, and were fighting each other over who would not gain custody.

Harvey, who is large and strong for his age, suffers from physical and mental conditions and needs constant care. Former glamour model Price complained that the comments, broadcast in December last year, were "discriminatory, offensive, demeaning and humiliating".

Channel 4 defended the comments, adding that its job was to champion and pioneer "distinctive voices in British comedy and bring them to a wider audience". It said that viewers were given strong warnings about the show, which started at 10pm, an hour after the watershed.

The broadcaster said that Price had already put her child in the public eye, had sparked complaints about being too sexually explicit in front of her children in her own reality show, and that her new husband Reid - who she has since split from - "made a series of public jokes about Harvey resembling the fictional character The Incredible Hulk".

The broadcaster said it was "these specific remarks and the general high profile of the child, that Frankie Boyle's joke is predicated upon". It said that the joke about custody was not about Harvey but "aimed clearly at Katie Price and Peter Andre, painting them as cynically exploiting a child in custody proceedings in the media."

But Ofcom said that any "intended satire in the two comments was ... obscured by their straightforward focus on Harvey Price and his disability." It accepted that Price, Reid and Andre "have consciously exposed their and their children's lives to the media".

But it said that this did not justify humour targeted at a child's expense, especially when the child is "as young as eight years old, and has a number of disabilities which are specifically focused on as the target of that intended humour".

Channel 4 said in a statement that it "acknowledges Ofcom's findings in relation to Frankie Boyle's Tramadol Nights and his comments about Katie Price. We welcome their finding that we were not in breach of the code regarding any other sketches or jokes within the series."