Colin Dexter, a British grammar school teacher turned author who created Inspector Morse, a curmudgeonly detective who adores real ale, poetry, Wagnerian opera and crossword puzzles and who became the hero of more than a dozen novels and a popular television series, died Tuesday at his home in Oxford, England. He was 86.

In announcing his death, Pan Macmillan publisher Jeremy Trevathan said that Dexter “represented the absolute epitome of British crime writing.” No cause was provided.

Adapted for public television and shown in 33 episodes in 200 countries between 1987 and 2000, the mysteries of murder most foul – in the academic serenity of Oxford – were no match for the brains and wit of Inspector Morse, who eventually solved the fatal and fiendishly complicated riddles, sometimes long after the fact.

The show’s producers once claimed to The Washington Post that 1 billion people around the world watched Inspector Morse and his sidekick Sgt. Lewis bring culprits to justice or at least to public exposure. In reruns, the audience has only swelled.

Inspector Morse was played by John Thaw, a British actor who died in 2002, and Kevin Whately portrayed Lewis; Dexter often made cameo appearances, playing variously a tourist, a doctor, a prisoner, a bishop and a bum.

A spinoff series based on Lewis and starring Whately ran on British TV from 2006 to 2015. In recent years, actor Shaun Evans played a young Morse in the prequel series “Endeavour.”

In a measure of Inspector Morse’s popularity, there were tours of Oxford with visits to real-life pubs he was said to have frequented and stops at fictional murder sites.

Dexter’s awards included two Golden Dagger prizes from the Crime Writers Association of Britain and its lifetime achievement award in 1997, a Diamond Dagger.

Norman Colin Dexter was born in Stamford, England, on Sept. 29, 1930, a birthday he shared with the fictional Endeavour Morse. He did not reveal Morse’s first name until late in the series.

In the final Inspector Morse book, “The Remorseful Day” (1999), the title character dies a natural death, although perhaps hastened by alcohol, tobacco and too little care of himself.

“I didn’t kill him off,” Dexter told The Post. “He just died.”

On the day the last Inspector Morse book was published, the lights in London’s Piccadilly Circus carried the message “R.I.P. Morse.”