When was the first story to have a main character who turns out to be a ghost but didn’t know it?

Recently I started a thread on a Pepsi commercial about a boy and his girlfriend will turn out to be dead at the end of the commercial and didn’t know it. This commercial came out in about 2003 which is four years after The Sixth Sense, so nothing particularly original there per se.

But then just now I learned there was an episode of are you afraid of the dark from 1994 called the tale of the dream girl where the same thing happens. So Shyamalan wasn’t completely original either.

My question is what was the very first fictional story to have a main character turn out to be a ghost at the end but he didn’t know it?

Probably not the first, but Lee Killough’s “The Existential Man” appeared in F&SF in 1982.

Charles E. Fritch’s “The Misfortune Cookie” was in F&SF in 1970.

While the details may vary, I think we can trace the concept back to Ambrose Bierce’s " An Occurrence at Owl Creek Bridge".

I think “ghost not knowing they are dead” is actually a pretty common element of folklore.

Here is one instance in a comic in 1969.

Which was made into a movie in 1929.

I seem to recall a morbid folk song in which a girl is being pursued by her former (and jealous) lover despite being married now and has to take the fellow’s hand and put it into his own wound to make him realize he’s been dead lo these fifteen years.

I didn’t interpret that story as saying Farquhar was a ghost. He was just imagining returning to his family in the final moments of his life. The cliche here is “It was all a dream.”

I’m going to put out Thomas Tryon’s 1971 novel, The Other, as an early example of this plot.

Wow, if somebody knows what folk song this is, let me know! This may be the real winner for the “first plot to have a Sixth Sense type ending” contest.

I just read the two sentence summary of that on Wikipedia; which character turns out to be dead? The good twin, the evil twin, or someone else?

True. That said, I think it’s also the origin of the “The protagonist was dead all along” cliché, even though he was technically still alive.

I’ll say right now I saw the movie but haven’t read the book.

There were two young twin brothers, Niles and Holland. Throughout the story, we see them together talking to each other. Holland is the bad twin, who is committing a series of crimes, including murder. Niles is apparently the good twin, who is trying to stop Holland from committing crimes but is loyal enough to his brother that he helps cover up his crimes. It’s finally revealed that Holland had died a year earlier and Niles is only imagining he’s still alive. It’s actually Niles who has been committing the crimes.

There’s the 2001 movie The Others.

There was a story (summarized, from memory) in a Bennett Cerf collection (he did mostly humor, but occasionally scary stories) about a young man named John who suddenly finds himself walking down a street in his hometown. When he greets people, they look at him in horror, and back away from him. He eventually finds a pay phone and calls his mother’s home. When he asks to speak to her, the person who answers asks, “Now why would you expect to find her here? Everyone in town knows she’s at the funeral of her poor son John, who was gruesomely killed in a sawmill accident two days ago”.

I thought of that one, and Siesta with Ellen Barkin and Gabriel Byrne.

The Twilight Zone episode ‘Judgment Night’ (1959) qualifies, I think. ‘The Hitch-Hiker’ (1960) definitely does, as do ‘The Passersby’ (1961) and ‘The Hunt’ (1962).

The first one? After reading this thread, I’ve dismissed the others.

I forgot to include the date on the Bennett Cerf story: the collection was published in the late 1940s-early 1950s, so the story probably dates to the early part of that range.

Carnival of Souls was very similar to the Inger Stevens Twilight Zone episode. It was 1960.

There’s the 1980 Tanith Lee novel Kill the Dead (and I’m now assuming that we’re looking for any story with this idea, not necessarily the first).

There was a story (by Lord Dunsany, I think) in the very early 20th century about a fellow telling a story in a bar, which ends with him trapped in an unescapable fatal situation. “My word, how did you survive?” “I didn’t”

My grandmother told us a Halloween story she heard as a little girl, about a revenant/vampire who came back, and did not realize it was dead. That would be around the 1900’s. Mind you the details are a bit different.

I think this goes back pretty far.

Owl Creek bridge is not after he is dead- it apparently is a story his mind tells him in the short time between being released and dying: wiki- It is revealed that Farquhar never escaped at all; he imagined the entire third part of the story during the time between falling through the bridge and the noose breaking his neck.