On the season six finale of Pretty Little Liars, Hanna and Caleb’s plan is put into action, Mrs. Hastings is elected as State Senator, and the identity of a twin is revealed.

Aria talks to Ali on the phone while she and the girls plus Caleb and Ezra wait for a reply from “Evil Emoji.” When she hangs up, she tells the others that Ali’s getting out of the hospital the next day and Elliott is going to a conference in Chicago, so she’ll be home alone. This concerns both Emily and Ezra, who remark that no one should be alone until after Hanna and Caleb’s plan is completed. At the same time, Evil Emoji responds to Hanna’s text: “If you’re lying, I shoot all of you.” This response raises some apprehension on Spencer's part, but Hanna trusts Caleb, so she does, too. Hanna sends a second message: “It’s the truth, I'll call the cops.” Evil Emoji says: “No police. This is between you and me.” Hanna sends a final message: “I need one more day.” Evil Emoji responds: “It’ll be your last.”

Cue opening theme.

Ali and Elliott recline on the couch and discuss her recovery. Elliott mentions Ali’s "tremendous strength," a trait, he notes, she and Charlotte share. Ali replies, saying she still misses her sister and is grateful that Elliott was able to help give her her sister back, even if it was only for a few short years. He also mentions a tribute for Charlotte being done by The Carissimi Group and how the money will be put to good use. A beat later, Elliott kisses Ali goodbye to head to the airport.

Spencer and Toby work on their part of Hanna and Caleb’s plan. Since Sara checked back into the Radley, she requested a first floor room directly above the basement. It’s up to Spencer and Toby to find whatever Sara is looking for and make sure she is locked out when Hanna’s waiting.

Emily arrives back to the apartment after purchasing the generator Caleb needs to build the electric fence. She says Hanna’s at the Radley, saying goodbye to her mom. Still worried about the potential consequences of the plan, Emily asks if the fence will kill Sara. Caleb claims it’ll only knock her out. Enter Hanna, who claims Sara deserves “more than a few volts.”

Spencer and Toby continue to map out their duties. Toby notes that Sara is working off a grid, yet she missed the east wing where the records room is located. On Sara's blueprint, there’s no visible door, meaning there's a secret door they’ll need to seal off, so Sara can’t get back in. Spencer says she’s good to go it alone, but Toby won’t have it. He’ll start on the prep work, since he can’t sneak in power tools during the election party at Radley. Spencer is grateful for Toby’s help, though she worries her request will cause tension between him and Yvonne.

Aria types while Ezra stares blankly at the wall. Aria asks him if he’s okay and Ezra becomes sad as he realizes he’s never going to see Nicole again. Aria apologizes for his loss and reassures him that he’s written her a beautiful love story. Ezra thanks Aria for pushing him to finish the project.

Ali sleeps on the couch while a movie plays on television. She wakes up when she hears music playing and goes upstairs to investigate; it’s her jewelry box. A moment later, Ali sees her mother, standing in the doorway, covered in dirt, and is startled. She drops the jewelry box and the glass inside the mirror breaks. When Ali returns to her living room, the landline rings, and a voice that sounds like Mrs. DiLaurentis's asks, “Did you miss me?” Ali drops the phone, horrified.

Later, Ali shares her dreams about her mother with Emily, who’s looking after her. Emily reassures Ali she’s not crazy; her painkillers are just messing with her head. From afar, someone watches the pair in the shadows.

Toby goes to The Brew to tell Yvonne he’s going to miss her mother’s election after-party, because of a favor he has to complete. It doesn’t take long before Yvonne realizes he’s helping Spencer.

The Hastings’ house is bustling with people doing last-minute campaigning. Mona also shows, offering to help, but Spencer questions her motives. When Mona insists she’s hasn’t been the enemy for a while, Spencer accepts her assistance with discretion.

Yvonne asks Toby what he’s helping Spencer with, but he says he can’t tell her, causing a fight between the pair.

At The Lost Woods Resort, Hanna and Caleb build the electric fence. The fence runs along the back, so they’ll have visuals on the front, and the motion sensors, lights, and cameras will help the group still get something if Sara realizes she’s been tricked.

Aria helps Emily look after Ali. She talks to Hanna on the phone and trades notes with Emily about Ezra’s book. Aria admits she’s been channeling her old feelings for Ezra into her chapters and worries what will happen when Liam reads them. Simultaneously, Ali is woken from sleep by visions of Detective Wilden. Her screams tip off Aria and Emily, who call Elliott for advice.

Caleb and Spencer go over finals details for the plan, before Mr. Hastings appears, wanting to have a word with his daughter.

Ali talks to Elliott and he tells her the hallucinations she’s having are the result of misplaced guilt; there’s nothing to worry about. Once Ali hangs up with her husband, she is plagued with involuntary images of her dead mother and Wilden again.

Yvonne declines Toby’s call.

Toby leaves Yvonne a message, promising her he’ll make things right.

Aria arrives at Ezra’s while he’s on the phone with Jillian. Ezra passes on her message that she loved the book and has big plans to market it. Both shocked and relieved, Aria gets caught up in the moment, and pulls Ezra in for a kiss. A beat later, she realizes her mistake, but by this time, he kisses her back, and the pair moves over to the bed, where things get steamier.

Hanna and Caleb wait inside The Lost Woods Resort and Hanna recalls the night they broke up. In the present, Caleb promises to keep Hanna safe.

Emily returns to Ali’s house and she’s gone. Elliott calls, asking to speak to Ali, but Emily tells him she can’t find her.

At the Radley, Spencer watches the votes come in and receives praise from both of her parents for the hard work she’s done on her mom’s campaign. At the same time, Emily calls, saying she she still hasn't found Ali and needs Spencer's help, though Spencer insists she can’t leave or the plan will be compromised.

Meanwhile, Ali goes to Rosewood Church.

Aria, Ezra, Hanna, and Caleb hang out at The Lost Woods Resort. When Aria and Ezra go outside to test the lights, Hanna tells Caleb she's let him down in the past by constantly putting her career before him and that she never stopped loving him. The pair shares a quick kiss just as Ezra returns, letting them know everything’s ready.

Spencer and Toby enact their part of the plan at the Radley.

Caleb says no one followed Aria and Ezra to The Lost Woods Resort, meaning Hanna has clearance text to Evil Emoji. She writes: “I’m at The Lost Woods Resort. Alone.”

Ali cries and convulses in Church. Emily soon arrives, mentioning how she’s gone crazy trying to find her. Ali says she knew her hallucinations wouldn’t follow her to Church and worries that she’s being punished for past wrongdoings. She breaks down, telling Emily she doesn’t know what’s real anymore and that she needs help. Emily is upset to see her friend in so much pain.

Spencer and Toby work to break through the wall covering the secret door when Spencer spots a shadow. Toby pulls his gun, but it’s just Mona. She wants to know what they’re looking for. When they get through to the other side, they find patient records for Mary Drake, who is Charles/Charlotte’s birth mother. Charles was adopted by Ken and Jessica and was closer to Jason in age than they let on. Mona surmises that the DiLaurentises probably lied about Charlotte's age because they didn’t want anyone to know she was adopted. Spencer says maybe that’s why Charlotte hid the papers. Mona thinks it’s the other way around, and Mary hid them.

At The Lost Woods Resort, the PLLs’ stalker watches Hanna through the bushes. Nearby, Caleb, Ezra, and Aria monitor the tracker and speed into action when the motion sensors go off. When no one shows, the group goes back to find Hanna, but she’s gone. Caleb’s in shock, since he ensured there’d be no way for Sara Harvey to get out.

Emily helps Ali check into a psych hospital. Emily is apprehensive, since Elliott will be home in the morning, but Ali doesn’t want to wait; she wants to get better. Emily ultimately supports her decision.

Veronica is elected State Senator and everyone celebrates at the Radley. Soon enough, Spencer gets a call from Aria that the plan backfired, and she and Toby rush out, unnoticed, with Mona in tow.

Spencer, Toby, and Mona arrive at The Lost Woods Resort. The others show them the hole in the floor as Caleb wonders why Mona has decided to join them. When video footage downloads, the group notes someone running through the woods.

At the DiLaurentis house, Wilden appears, his shirt covered in blood. A beat later, it is revealed that it’s Elliott wearing a Wilden mask, with Mary Drake at his side. With Ali in the hospital, he now controls 51 percent of The Carissimi Group. Elliott married Ali, as a favor to Mary, since he was the only man Charlotte ever loved. With Elliott's help, Mary is taking back what’s hers; it’s what Charlotte would’ve wanted.

Back at The Lost Woods Resort, the group determines the person running is Mrs. DiLaurentis. Before long, a text arrives: “Thanks for giving me, Hanna. You’re free to go.” – A.D. Everyone is visibly stunned.

At Rosewood Church, the PLLs’ stalker drags an unconscious Hanna up to the bell tower, with roses clutched to her chest.

End of episode.

Pretty Little Liars airs every Tuesday at 8 p.m. on Freeform. The series will begin its seventh season with all-new episodes this summer.