After making its debut in January, the BBC's latest thriller Rules of the Game gripped audiences with its compelling story about sexual politics in the workplace.
MORE: Rules of the Game viewers left 'speechless' after devastating twist in episode three
If you've been left reeling after the final episode and need a breakdown of how it ended, here's all you need to know.
WATCH: What did you think of the thriller?
Rules of the Game ending
At the end of episode four, we learned that it was new HR director Maya who ended up dead on the floor of Fly Dynamic's reception. While it looks like a suicide, DI Eve Preston believes there's more to it and is fuming with her colleagues after realising that nobody noticed it was Maya who reported a break-in to the police the night before she died.
In a flashback, Sam asks Maya to sign a non-disclosure agreement about everything she's discovered about the death of former employee Amy, but Maya refuses.
MORE: Maxine Peake looks amazing in throwback to early career
MORE: Rules of the Game: viewers all saying the same thing about episode two
In the present, senior management of Fly Dynamic tell their employees that Maya died by suicide but are met with an outburst from Tess, who tells them they have "blood on your hands".
HR director Maya was found dead
Meanwhile, after realising that his wife has emptied his locked safe that contained explicit videos of him and Amy, Gareth confronts her. Carys tells him that she's given the flash drive to Sam, who later lies to him, saying she destroyed it. The camera then pans to a wide shot and the viewer sees the flash drive sitting on top of Sam's kitchen cabinet.
The Fly Dynamic staff attend Maya's funeral, where Tess reads a passage from Bhagavad Sita, the book that Maya gave to her. The camera pans to Sam who recognises the passage, which is similar to the suicide note found with Maya's body.
MORE: Rules of the Game: everything you need to know about the BBC's new thriller
Meanwhile, the police arrest Luke and question him about the secret tracking device he had installed on Maya's car, as well as his stalking and breaking into her house.
Tess read a passage from the book Maya gave her at her funeral
Back at the office, after asking what happened to the NDA, Owen tells Sam that Maya signed it and that the entry records showing Amy visiting Gareth on the night she died are now gone. When Duncan sees Owen going into Maya's office, he tells him that her belongings have been delivered to her mother already.
Sam goes back home and Gemma tells her that it was Owen's son, Adam, who had been supplying Danny with porn, and also implied that Owen had been inappropriate towards her but didn't feel as though she could tell her mum due to her previous comments about sexual harassment victims.
MORE: Rules of the Game filming locations: Where is the BBC drama set?
Sam then receives a payment into her bank account of £500,000 from Haranit Holdings Company. After talking with Vanessa, she learns that the account belongs to Anita, not Owen.
She then goes to confront Anita, who goads Sam about her relationship with her late husband Harry, who sexually harassed Sam when she first started at the company and fathered her daughter Gemma. Anita tells Sam that the £500,000 is a "bonus".
Anita spiked Maya's drink
In a flashback, we learn that Maya bumped into Anita in the office on the night she died and that Anita tried to convince her to sign the NDA. When Maya refused, Anita took her anxiety medication and spiked a glass of whiskey, which she then offered to Maya. When Owen arrives to find Maya passed out on the sofa, Anita tells him to deal with it and he throws her over the balcony before leaving the note.
Later, Sam goes home and tells Gemma who her real father is. Gemma tells her she should "blow the company up".
Sam heads to Maya's house to look for the entry records but Owen sees her whilst dropping Vanessa off at her friend's house, who lives opposite. Owen follows her in and attacks her. While strangling her, he reveals that Amy was killed by Gareth during a "sex game gone wrong". Sam manages to grab a heavy ornament and hits him over the head.
Sam discovered that Gareth had killed Amy by accident
Sam then tells the police everything she knows about Amy's death - that Gareth killed her and Owen dumped her body outside the nightclub. She also reveals that Anita had spiked Maya and Owen staged her death.
Sam takes over the company and tells the shareholders that Fly Dynamic have managed to repair its image by creating a campaign that "brings together female athletes to speak out against violence towards women".
In the final scenes, Tess tells Sam she's leaving to train as a spin instructor in Ibiza, turning down the job she offered her at the company. Tess tells Sam that she believes that she was out for power all along and that people don't change. "I'll be watching you, Sam," she utters before leaving.
Like this story? Sign up to our newsletter to get other stories like this delivered straight to your inbox.