DON'T they know anything about children? The British Board of Film Classification seem to think young minds risk being traumatised by the new Horrible Histories film and have rated it "PG" (parental guidance) due to scenes featuring “mild comic violence, injury detail, rude humour” and “language”.

Yet, as any parent will tell you, rude jokes and slapstick violence are exactly what small kids like – which is precisely why the original Horrible Histories books have sold more than 25 million copies and counting. It also explains the success of the eponymous TV series, which scores by tackling "subjects that really interest kids – death, sh**, blood and piss", in the words of celebrated comedy writer Jesse Armstrong.

Horrible Histories: The Movie premieres in London tonight and it looks as if there will be plenty of bodily functions on show. The official trailer opens with the rotten Roman Army invading Britain to a chorus of jeers and loud burps from the unimpressed natives. When an even ruder sound erupts from the crowd, a bossy looking centurion demands: "Who was that?" only for one revolting Briton after another to pipe up: "I'm Fartacus!" "No, I'm Fartacus." And so on.

Gleeful toilet humour has been a hallmark of the Horrible Histories franchise from the outset. Running to more than 60 titles including Groovy Greeks, Cut-throat Celts and Vile Victorians, the books were written by Terry Deary, a Sunderland-born former actor who was working as a children's novelist in 1993 when he was asked to write a "history joke book" for kids.

“I don't know anything about history,” said Deary, who hates schools (which he calls "pits of misery and ignorance") and despises historians (whom he describes as devious charlatans who are "nearly as seedy as politicians").

"Don't worry, we'll give you the facts,” said his publisher. “All you have to do is write the jokes that go with them.” Despite his initial reluctance, Deary discovered that the facts were extremely interesting and on completing his first Horrible History, The Terrible Tudors, he realised he'd written not a "joke book with facts" but "a fact book with jokes" – and a new genre was born.

History with the boring bits left out and the gory bits left in is the books' unique selling point and parents snapped them up in the faint hope of turning their children on to something scholarly.

To their delight, their offspring devoured the books, relishing all those gruesome anecdotes about William the Conqueror (whose chubby corpse exploded messily at his funeral), Greek medic Hippocrates (whose diagnostic technique involved tasting patients' bogies) and King Henry II (who employed a professional flatulist called Roland the Farter as a court jester).

Deary – a butcher's son who hates the establishment as much he loathes schools and historians – believes part of his books' appeal lies in the way they poke fun at the rich and powerful. And although he considers children's television to be an arena for "shouty, patronising voices", he accepted CBBC's invitation to work on a kids' TV series, helpfully upping the "poo quotient" at the broadcaster's request. Crucially, the series employed adult sketch show writers rather than children's ones and was an immediate hit when it screened in 2009.

Two years later it became the first children's programme ever to win best sketch show at the British Comedy Awards and many of the show's skits and songs have become YouTube sensations, most notably the deeply anti-monarchist Four Georges ("Born to rule over you ... you had to do what we told you to, just because our blood was blue") and one featuring the Grim Reaper as a receptionist at the “death check-in”, where he greets historical figures who've met with ignominious ends such as being hit on the head by a tortoise or tripping over their own beard. The latter sketch even has its own theme song ... "Stupid Deaths, Stupid Deaths! They're funny 'cause they're true! (Ooh!) Stupid Deaths, Stupid Deaths! Hope next time, it's not you (hoo-hoo!)".

"The point, from the outset, was to stress that this was a comedy show based on history, not a history show with a bit of humour grafted on," said series co-writer, Steve Punt, in The Guardian. "It's a fact of comedy writing that the tighter the brief, the better the result.

"Plucking comedy out of the air is what leads to clichés and well-worn themes. But knowing that you have to stick to the facts of what the Celts wore, or how the Tudors treated illness, concentrates the mind. It leads you into strange areas that you would never have thought of, and that's always creatively a good thing."

Executive producer Richard Bradley has described the series as bottling "the spirit of Blackadder, Monty Python and Carry On", so it's perhaps not surprising that it's almost as popular with adults as children. Two years into its run the show was repackaged for the main BBC One channel with Stephen Fry (rather than a puppet rat) as presenter.

"People tend to go on about Horrible Histories being 'not just a kids' show but a proper comedy show', but actually I don't see the dichotomy there," said comedian and series guest star David Baddiel, theorising that contemporary children's linguistic sophistication makes it possible to create a clever, funny show with cross-generational appeal.

"It uses history brilliantly," he added. "They had a sketch once about how Henry VIII only found out about Catherine Howard's adultery from his jester, since everyone else was too frightened to tell him, which was both poignant and funny – and, of course, told me something I didn't know about the Tudors."

Not everyone is a fan. In 2015, history teacher and Civitas think tank research fellow Robert Peal blamed the series for encouraging children "not to think about the past but to laugh at it". Writing in The Times Educational Supplement, he also said Horrible Histories was a "dumbing down" influence on school textbooks, which he accused of pandering to pupils' "supposedly minimal attention spans" with chapter headings such as "Was Henry V a gangster?" and "Match of the Day: England vs Spain" (above an account of the Spanish Armada).

However, Northumbria University historian Tom Lawson took issue with that censorious view, praising the series for deviating from the usual “reverential”, “Great Men” approach to the past. “Horrible Histories is entirely contemptuous of power and invites children to be the same – by poking fun at the foibles and failings of leaders,” he wrote in The Conversation. “The message is clear: authority has to be earned, it is not a right. And who could argue against the idea of educating our children to critically appraise those in positions of power?"

Lawson welcomed the books' focus on the social history of ordinary people's lives, and even their preoccupation with bodily fluids. "The regular inclusion on the role of excrement and sewage is not simply toilet humour,” he insisted. “It teaches children (and some adults) about topics like our relationship with the environment and the role of disease."

At least one Cambridge academic seems to agree with him. Last month, the university's history students were set an exam question which name-checked the popular franchise: "'I'm a knight/ And my only aim in life is to fight' [Horrible Histories, I'm A Knight song]. How accurately does this describe the role of the knightly class in English society?" students were asked.

Unfortunately, their answers have not been revealed, but Terry Deary's creation seems certain to keep on growing at the rate of a pus-filled boil in a Black Death sufferer's armpit. To date, there have been eight TV series totalling 105 episodes as well as a hit stage show and a slew of merchandise, including a Horrible Histories Monopoly set.

Horrible Histories: The Movie – Rotten Romans premieres tonight in Leicester Square and goes on general release from July 26. Directed by Dominic Brigstocke, it stars Sebastian Croft as a teenage Roman soldier who is sent to "miserable, cold, wet" Britannia to quell the uprising led by Boudicca (played by Kate Nash). The stellar cast includes Nick Frost, Kim Cattrall, Sanjeev Bhaskar and even Derek Jacobi as Claudius – the role he played memorably in the 1976 adaptation Robert Graves's I, Claudius.

Deary has promised “the most horrible movie you’ll see in 2019" and no doubt it will be packed full of blood, guts and puerile lavatorial gags. How could we possibly resist?

Five ghastly facts from Terry Deary's Horrible Histories

:: During the Stone Age, migraines and mental illness were treated by drilling holes into people's skulls.

:: In medieval Britain, a family's urine was collected, stored and used in laundry as a bleaching agent. Soap was made by boiling wood ash with meat fat.

:: Tudor dentists used human excrement mixed with honey to remove rotten teeth.

:: The execution of Margaret Pole, the Countess of Salisbury, in the Tower of London on May 27, 1541, was a long, drawn out affair. It took 11 blows of the axe to remove her head.

:: During Georgian-era Highland Games, one of the events involved a competition to rip all four legs off a dead cow. The prize was a fat sheep: whether with or without limbs is unrecorded.