One morning Brian Cohen, completely naked, flung open the shutters at his bedroom window to find a mob below hailing him as the Messiah. Mrs Cohen, played by Terry Jones, who has died aged 77, had something to say about that. “He’s not the Messiah. He’s a very naughty boy,” she told the disappointed crowd. It became a classic cinema moment.

The 1979 film Monty Python’s Life of Brian, a satire about an ordinary Jewish boy mistaken for the Messiah, which Jones directed and co-wrote with his fellow Pythons Graham Chapman, John Cleese, Terry Gilliam, Eric Idle and Michael Palin, was banned by 39 British local authorities, and by Ireland and Norway. Jones and his chums were unrepentant: they even launched a Swedish poster campaign with the slogan: “So funny it was banned in Norway.”

As for Jones’s performance as Mandy Cohen, it united two leading facets of the funnyman’s repertoire: his fondness for female impersonation, and his passion for historical revisionism. The latter was evident not just in his work for Monty Python – in which his historian’s sensibility proved essential to the satire of Arthurian England in Monty Python and the Holy Grail (1975), which he co-directed and co-wrote – but also in several documentaries and books in which he stood up for what he took to be the misrepresented Middle Ages.

“We think of medieval England as being a place of unbelievable cruelty and darkness and superstition,” he said. “We think of it as all being about fair maidens in castles, and witch-burning, and a belief that the world was flat. Yet all these things are wrong.”

Arguably, without Jones, Monty Python’s Flying Circus (1969-74) would not have revolutionised British TV comedy. He was key in developing the show’s distinctively trippy, stream-of-consciousness format, where each surreal set-up (the Lumberjack Song, the upper-class twit of the year show, the dead parrot, or the fish-slapping dance) flowed into the next, unpunctuated by punchlines.

For all his directorial flair, though, Jones may well be best remembered for creating such characters as Arthur “Two Sheds” Jackson, Cardinal Biggles of the Spanish Inquisition, the Scottish poet Ewan McTeagle and the monstrous musician rodent beater in the mouse organ sketch who hits specially tuned mice with mallets.

Facebook Twitter Pinterest Terry Jones, left, and John Cleese in The Meaning of Life (1983), in which he made, perhaps, his most disgusting appearance, as Mr Creosote. Photograph: Alamy

Thanks to the show’s success, Jones was able to diversify into working as a writer, poet, librettist, film director, comedian, actor and historian. “I’ve been very lucky to have been able to act, write and direct and not have to choose just the one thing,” he said.

Jones was a second world war baby, born in Colwyn Bay, north Wales, and brought up by his mother, Dilys (nee Newnes), and grandmother, while his father, Alick Jones, was stationed with the RAF in India. He recalled meeting his father for the first time when he returned from war service: “Through plumes of steam at the end of the platform, he appeared – this lone figure in a forage cap and holding a kit bag. He ran over and kissed my mum, then my brother, then bent down and picked me up and planted one right on me. I’d only ever been kissed by the smooth lips of a lady up until that point, so his bristly moustache was quite disturbing.”

When he was four, the family moved to Surrey so his father could take up an appointment as a bank clerk. Terry attended primary school in Esher and the Royal Grammar school in Guildford. He studied English at St Edmund Hall, Oxford, and developed a lifelong interest in medieval history as a result of reading Chaucer.

At Oxford, he started the Experimental Theatre Company with his friend and contemporary Michael Rudman, performing everything from Brecht to cabaret. He also met Palin and the historian Robert Hewson, and collaborated with them on a satire on the death penalty called Hang Down Your Head and Die. It was set in a circus ring, with Jones playing the condemned man. He and Palin then worked together on the Oxford Revue, a satirical sketch show they performed at the 1964 Edinburgh festival, where he met David Frost as well as Chapman, Idle and Cleese.

After graduation, he was hired as a copywriter for Anglia Television and then taken on as a script editor at the BBC, where he worked as joke writer for BBC2’s Late Night Line-Up (1964-72). Jones and Palin became fixtures on the booming TV satire scene, writing for, among other BBC shows, The Frost Report (1966-67) and The Kathy Kirby Show (1964), as well as the ITV comedy sketch series Do Not Adjust Your Set (1967-69).

Facebook Twitter Pinterest Terry Jones, right, and Graham Chapman in Monty Python’s Life of Brian (1979), which was banned by 39 British local authorities, Ireland and Norway. Photograph: Python/Allstar

In 1967, he and Palin were invited to write and perform for Twice a Fortnight, a BBC sketch show that provided a training ground not only for a third of the Pythons (Jones and Palin), but two-thirds of the Goodies (Graeme Garden and Bill Oddie) and the co-creator of the 1980s political sitcom Yes Minister, Jonathan Lynn.

Jones and Palin wrote and starred in The Complete and Utter History of Britain (1969) for LWT. Its conceit was to relate historical incidents as if TV had existed at the time. In one sketch, Samuel Pepys was a chat show host; in another, a young couple of ancient Britons looking for their first home were shown around the brand-new Stonehenge. “It’s got character, charm – and a slab in the middle,” said the estate agent.

In the same year, he became one of the six founders of Monty Python’s Flying Circus. They expected the show to be quickly decommissioned by BBC bosses. “Every episode we’d be there biting our nails hoping someone might find it funny. Right up until the middle of the second series John Cleese’s mum was still sending him job adverts for supermarket managers cut out from her local newspaper,” Jones recalled. “It was only when they started receiving sackfuls of correspondence from school kids saying they loved it that we knew we were saved.”

After Python finished its run on TV, Jones went on to direct several films with the troupe. The first, Monty Python and the Holy Grail, was, he recalled, “a disaster when we first showed it. The audiences would laugh for the first five minutes and then silence, nothing. So we re-cut it. Then we’d show it in different cities, saying, ‘We’re worried about our film, would you come and look at it?’ And as a result people would come and they’d all be terribly worried about it too, so it was a nightmare.”

He had more fun co-writing and directing two series for the BBC called Ripping Yarns (1976-79) in which Palin starred as a series of heroic characters in mock-adventure stories, among them Across the Andes by Frog, and Roger of the Raj, sending up interwar literature aimed at schoolboys.

Jones directed and starred in Monty Python’s Life of Brian, which some religious groups denounced for supposedly mocking Christianity. Jones defended the film: “It wasn’t about what Christ was saying, but about the people who followed him – the ones who for the next 2,000 years would torture and kill each other because they couldn’t agree on what he was saying about peace and love.”

In 1983 he directed Monty Python’s The Meaning of Life, in which he made, perhaps, his most disgusting appearance, as Mr Creosote, a ludicrously obese diner, who is served dishes while vomiting repeatedly.

During this decade Jones diversified, proving there was life after Python. In 1980, he published Chaucer’s Knight: The Portrait of a Medieval Mercenary, arguing that the supposed paragon of Christian virtue could be demonstrated to be, if one studied the battles Chaucer claimed he was involved in, a typical, perhaps even vicious, mercenary. He also set out to overturn the idea of Richard II presented in the work of Shakespeare “who paints him more like sort of a weak … unmanly character”. Jones portrayed the king as a victim of spin: “There’s a possibility that Richard was actually a popular king,” he said.

This video has been removed. This could be because it launched early, our rights have expired, there was a legal issue, or for another reason. Five memorable moments from the career of Monty Python's Terry Jones – video

He wrote children’s books, starting with The Saga of Erik the Viking (1983), which he composed originally for his son, Bill. A book of rhymes, The Curse of the Vampire’s Socks (1989), featured such characters as the Sewer Kangaroo and Moby Duck.

In 1987, he directed Personal Services, a film about the madam of a suburban brothel catering for older men, starring Julie Walters. The story was inspired by the experiences of the Streatham brothel-keeper Cynthia Payne. Jones proudly related that three of four films banned in Ireland were directed by him – The Life of Brian, The Meaning of Life and Personal Services.

Two years later, he directed Erik the Viking, a film adaptation of his book, with Tim Robbins in the title role of a young Norseman who declines to go into the family line of raping and pillaging. In 1996, he adapted Kenneth Grahame’s Wind in the Willows for the big screen, giving himself the role of Mr Toad, with Ratty and Mole played by Idle and Steve Coogan. But it was rarely screened in cinemas. “It was ruined by studio politicking between Disney and Columbia Tristar,” he said. “We made a really nice film but no one saw it. It didn’t make any money, even though it was well reviewed.”

Jones was also unfortunate with his next film project. Absolutely Anything, based on a script he wrote with the screenwriter Gavin Scott, concerned aliens coming to Earth and giving one person absolute power. Plans were scuppered when a movie with a similar premise, Bruce Almighty, starring Jim Carrey, was released in 2003. Only in 2015 did Jones manage to film Absolutely Anything, in which Simon Pegg, playing a mild-mannered schoolteacher, is given miraculous powers by a council of CGI aliens voiced by Jones and his former Monty Python colleagues. Robin Williams, in one of his last roles, voiced Pegg’s dog.

Letter: Terry Jones obituary Read more

Jones made well-received history documentaries, including in 2002 The Hidden History of Egypt, The Hidden History of Rome and The Hidden History of Sex & Love, in which he examined the diets, hygiene, careers, sex lives and domestic arrangements of the ancient world, often appearing in the films as an ancient character, sometimes dressed as a woman.

In his book Who Murdered Chaucer? (2003), he wondered if the poet had been killed on behalf of King Henry IV for being politically troublesome.

He wrote for the Guardian, about the poll tax, nuclear power and the ozone layer. He became a vocal opponent of the Iraq war, and his articles on the subject were collected under the title Terry Jones’s War on the War on Terror (2004).

In his 2006 BBC series Barbarians, Jones sought to show that supposedly primitive Celts and savage Goths were nothing of the kind and that the ancient Greeks and Persians were neither as ineffectual nor as effete as the ancient Romans supposed. Best of all, he sought to demonstrate that it was not the Vandals and other north European tribes who destroyed Rome but Rome itself, thanks to the loss of its African tax base.

When Jones was asked what he would like on his tombstone, he did not want to be remembered as a Python, perhaps surprisingly, but for his writing and historical work. “Maybe a description of me as a writer of children’s books or maybe as the man who restored Richard II’s reputation. I think those are my best bits.”

In 2016, it was announced that Jones had been diagnosed with primary progressive aphasia, a form of dementia that impairs the ability to communicate. He and his family and friends spoke about his experiences to help others living with the condition.

Jones is survived by his second wife, Anna (nee Söderström), whom he married in 2012, and their daughter, Siri; and by Bill and Sally, the children of his first marriage, to Alison Telfer, which ended in divorce.

• Terence Graham Parry Jones, writer, actor and director, born 1 February 1942; died 21 January 2020