Where did the pineapple Ted Mosby woke up to the morning after a drunken one-night stand come from? The mystery was one of the longest-running of How I Met Your Mother. And in the series proper, the truth of where the pineapple came from was never revealed, leaving fans to speculate about the circumstances behind the incident for years.

The "Pineapple Incident" was Episode 10 of Season 1 of How I Met Your Mother. While drinking at MacLaren's pub, Ted's friends criticize him for overthinking every aspect of his life rather than being more spontaneous. Egged on by their comments, Ted is convinced to take five shots of a drink called the "Red Dragon," and promptly blacks out until the next morning when he finds an unfamiliar girl in his bed and a pineapple on his nightstand. Ted has no memory of the previous night, and his friends spend the remainder of the episode trying to piece together what happened.

RELATED: Hunters' Josh Radnor On Saying 'Yes' To Projects & Artistic Fulfillment

Throughout the night, Ted experienced a series of drunken mishaps: He repeatedly drunk dialed Robin, sang a Cheap Trick song in front of the entire bar, sprained his ankle falling off a table, and had his coat lit on fire by Barney. Trudy, the brunette Ted found in his bed, fills Ted in on the rest of the story, but she doesn't have an explanation for how the pineapple got into his bedroom. Future Ted's narration then revealed the gang never found out where the pineapple came from, ultimately cutting off any hope that the mystery would be solved.

Television how I met your mother

Series co-creator Carter Bays regretted the narrative hole he and the writing staff wrote themselves into. And while the mystery of the pineapple would presumably never be resolved on the show, clues were sprinkled throughout. In a flashback in the Season 3 episode, "Third Wheel," it was revealed that the pineapple was already in Ted's room by the time he invited Trudy to his apartment. But despite Ted's self-proclaimed detective skills, the mystery was still unsolved eight years after the initial incident, and a gag during the ninth season of the series highlighted the absurdity of the unsolved case.

However, the origins of the pineapple were eventually revealed in a deleted scene from How I Met Your Mother, released as part of the final season DVD boxset. In the Season 9 episode, "Daisy," Ted and friends team up to find Lily, who disappears from the Farhampton Inn during Barney and Robin's wedding weekend. They end up going to the Captain's manor where they discover that Lily is pregnant with her second child. In the deleted scene, the Captain makes a playful joke about Ted not stealing from him a second time, an obvious reference to how Ted stole Zoey, the Captain's ex-wife. But, as it turns out Zoey wasn't the first thing Ted stole from him.

While leaving the Captain's manor, Ted notices a pineapple sitting by the doorway. The Captain explains its an old maritime tradition to leave a pineapple by your front porch as a symbol of hospitality. He also mentions leaving one at the entrance of his townhouse in the city. Ted suddenly has a flashback to 2005 showing that, prior to meeting Trudy at his apartment, he stole a pineapple from the Captain's house during his drunken stupor. And with that, the Pineapple Incident is solved.

RELATED: Palm Springs Is the Perfect Comedy for This Moment

The scene wasn't included in the final cut of the episode despite how vocal fans were about their desire to discover the answer to the pineapple mystery. Of course, Ted discovering the truth would have created a plot hole, as his future self already stated he never learned what happened, although Ted was clearly in disbelief about whether or not he stole the pineapple in the deleted scene. Alyson Hannigan, who portrayed Lily, took to social media to explain the scene was ultimately cut due to time constraints.

Despite the controversy surrounding the series' ending, the inclusion of the scene revealing the origins of the pineapple would've been a rewarding, long-awaited addition to the final season. At least the deleted scene finally provides an answer to the mystery.

KEEP READING: The Office Guide to Jim Halpert's Season 3 Hair (Or Wig Vs. No Wig)