A murder mystery plot twist I've never seen (possibly open spoilers)

Has there ever been a book, short story, or film, where the detective investigating the murder turned out to be the murderer?

Since the very nature of this question involves spoilers, I’ll invite you to use spoiler tags, but anyone who does not want to see spoilers should skip this thread.

So you’re excluding the very famous stage play?

Well, one of Agatha Christie’s novels very famously has the murderer turn out to be the detective’s sidekick. Is that close enough?

Other forms that I didn’t list are also fair game, and I guess whatever you’re thinking of is famous to everyone but me.

That’s pretty good. I thought I had read all her stories but it’s been many years and I don’t remember that one. I don’t even remember a detective with a sidekick.

Thanks, I’ve certainly heard the title but never seen it performed nor read a script.

I just saw one recently. It’s 40+ years old, but I’ll spoiler it anyway.

Eyes of Laura Mars. Faye Dunaway plays a fashion photographer, Laura Mars, who starts having psychic visions people being murdered. Her visions are from the killer’s POV, so she doesn’t know who’s doing the killings. The victims are all people she knows, so she’s in danger, too. Tommy Lee Jones plays the detective on the case. A romance develops between him and Mars. The film ends with him coming to her rescue, but it’s gradually revealed that he has multiple personalities, one of which is the killer.

The Real Inspector Hound

To be fair, Agatha Christie books include circumstances where pretty much every stock character is the murderer in one book or another: the police detective, the obnoxious kid detective, the unreliable narrator, the apparent intended victim, one of the actual victims, everybody, random bystanders, Hercules Poirot…

I don’t think there’s one where the dog does it, but I wouldn’t be surprised if there were.

Three others I know of:

From a classic detective series:

A Family Affair by Rex Stout, in which Orrie Cather, one of the private detectives that Nero Wolfe uses to do the legwork on his cases in many of his earlier books turns out to be the killer

A T.V. movie based on an iconic series:

Exiled: A Law & Order Movie, in which Detective Profaci, who assisted in numerous cases during the run of the T.V. show, turns out to be the killer.

As I was just reminded by Gyrate’s post:

Curtain, Hercule Poirot’s last case, in which he turns out to be the killer

There is an episode of Columbo where the dogs did it (no spoiler since of course Columbo starts with the killers), but of course they were under orders from a human murderer.

I just realized you meant an Agatha Christie where the dog did it - In Dumb Witness, the dog didn’t do it, but he is the “dumb” (mute) witness who helps Poirot solve the case

Well, it wasn’t an official Batman & Robin type of thing.

OTOH, I don’t see how you could possibly consider the Poirot/Hastings relationship in some of the novels as anything but ‘sidekick.’

From Adaptation. (2002):

Donald Kaufman: I’m putting in a chase sequence. So the killer flees on horseback with the girl, the cop’s after them on a motorcycle and it’s like a battle between motors and horses, like technology vs. horse.
Charlie Kaufman: And they’re still all one person, right?

Charlie Kaufman: How could you have somebody held prisoner in a basement and… and working at a police station at the same time?
Donald Kaufman: [pause] Trick photography.

Star Trek ep. “Wolf In The Fold.”

1987 movie Angel Heart.

In this case, it’s not only the audience who is in the dark - the private investigator doesn’t realize he’s been committing the murders until the end.

And of course it has happened in real life.

The film Fallen is sort of like this, if you count demonic possession.

Alternate interpretation: The people who die really were killed by a series of diabolical coincidences, but Louie set it up so that it would look exactly as if the protagonist was hunting down and murdering witnesses. Or maybe even in an altering-time sense both are true.

This is revealed to have been so in THE LAST OF SHEILA, where we eventually get plenty of helpful exposition about the sleuth who’s only ever been showily acting like he’s been figuring out that the clues point to the person he’d framed: “And it was brilliant! What better detective than the man who’s committed the crime? Every hesitant conclusion, every stumbling interpretation…”

Not the detective himself, but the detective’s boss, running the department and directing the investigation.