Here’s the twist ending of The Girl On The Train explained, plus which character turned out to be the killer. Based on British writer Paula Hawkins’ debut novel, The Girl On The Train is a psychological thriller brought to the big screen by director Tate Taylor (The Help). The movie stars Emily Blunt who gives a BAFTA-nominated performance as alcoholic divorcee Rachel Watson who has an unhealthy fixation on her ex-husband Tom (Justin Theroux), his new wife Anna (Rebecca Ferguson) and their neighbors Scott (Luke Evans) and Megan (Haley Bennett) – the latter two she’s come to idolize.

Since getting fired from her job Rachel spends her days riding the Metro-North line between New York City and suburban Westchester, passing by the home she used to share with Tom. During one of her voyeuristic journeys, Rachel thinks she sees Megan – who used to nanny for Tom and Anna – cheating on her husband. After drunkenly confronting Megan about her infidelity and getting knocked out, Rachel finds herself embroiled in a murder investigation when Megan goes missing and soon turns up dead.

Related: Every Time I Die's Ending Explained

As The Girl On The Train progresses, three main suspects in Megan’s murder come to light; her emotionally abusive husband Scott, her therapist Kamal Abdic (Édgar Ramírez, The Last Days Of American Crime) who Rachel thinks Megan was cheating with, and Rachel herself who was so drunk she can’t really remember what happened the night of Megan’s murder. Rachel initially comes across as an unreliable narrator thanks to her drinking problem, with flashbacks revealing her alcoholism (spurred on by her infertility issues) caused the breakdown of her marriage with Tom and even led to him losing his job.

The Girl On The Train Justin Theroux Emily Blunt

However, as Rachel desperately seeks answers in The Girl On The Train, a couple of interesting bits of information come to light. Firstly, it turns out Megan was pregnant and the father was neither her husband or therapist. Secondly, a chance encounter Rachel has with Tom’s former boss’ wife Martha (Lisa Kudrow, Friends) leads to her learning her ex-husband had a habit of gaslighting her and was fired not because of Rachel but because of his extracurricular activities with female co-workers. Thus comes The Girl On The Train’s big plot twist.

Rachel eventually pieces together what happened the night Megan was murdered. She remembers that she saw Megan with none other than Tom before she was knocked out (by Tom, no less). It’s revealed Tom and Megan were having an affair and after Megan told him she was pregnant with his child he killed her in a fit of rage. In the final few scenes of The Girl On The Train, Rachel rushes to warn Anna about Tom and – after a terrifying confrontation in which he reveals his true colors – the two women kill him in self-defense.

Next: The Next Three Days Ending Explained