SPOILER ALERT: Do not read ahead if you have not watched the “Pretty Little Liars” series finale, which aired June 27 on Freeform.

After seven seasons of whodunnit mystery, cliffhangers, and torment by “A,” the Liars finally found out the true identity of Rosewood’s villain … Spencer (Troian Bellisario) has a twin!

The identical twin with a British accent is named Alex Drake — A.D., get it? — and is Mary Drake’s (Andrea Parker) other daughter, who was sold as an infant upon birth so that Mary Drake could pay her way out of the Radley Sanitarium mental institution. Mary Drake sent her to a wealthy family in London, thinking she would have a great life, but instead, Alex ended up at an orphanage and never had a real family. Her lack of family, in comparison to Spencer’s seemingly “perfect” life, is what prompted her to take down the Liars.

Alex showed up in Tuesday night’s finale and locked up Spencer with a plan to pose as her sister for the rest of her life. Of course, that didn’t happen because the Liars and the men of Rosewood came together to crack the case at the last minute, and all lived happily ever after.

Here, “Pretty Little Liars” creator Marlene King speaks to Variety about the series finale

How long was this the plan for Spencer to have a twin and for the twin to be A.D.?

We started talking about it before Charlotte’s death so between 5B and 6A, and I knew we couldn’t continue the story until we knew what that ultimate ending was going to be — if we’re going to bring in a new “A,” we’re going to have to know who it is and why it’s happening before starting the story.

Aside from Alex Drake, can you confirm once and for all, who was the full A-team?

For the first two seasons, it was Mona. She’s original “A.” And then Charlotte stole it from her and she’s “Big A.” And then the death of Charlotte was the genesis for “A.D.”

Have you been keeping up with all of the fan reaction to the finale on social media?

I haven’t been online, to be honest with you. I’m intentionally staying off of social media for a couple of days to give myself a breather.

How many times did we see Alex as Spencer through the course of the series?

I think her first time on-screen was when Hanna was being tortured in the shed and she dreamt that Spencer came to her to reassure her and give her a clue to get out, that was Alex. After Yvonne died and Toby was leaving town and Spencer came to say goodbye to Toby and asked for a kiss, that was Alex. We saw Alex wearing an argyle sweater in the Hastings home looking at family photographs. Two episodes ago, when Spencer went to go visit Toby in the cabin and they had that crazy wild sex, that was Alex.

That’s so twisted, Marlene!

I know. [Laughing] Sorry! Spoby fans were not happy.

When you told Troian that she would be playing “Uber A,” what was her reaction and what went into the prep work to master two characters?

She was amazing. She knew for two years and then we started honing in about a year ago on the real backstory of the character, so she’s been working on that dialect for a long time and she really did her homework.

How did the other girls react when they found out it would be Troian playing “A.D.” ultimately?

We didn’t tell anyone. Troian wanted to keep it a secret because she didn’t want people to know it was “A.D.” when they were acting in those scenes. Little by little, some people started to figure it out. By the time it was Alex Drake and Toby having sex in episode 18, some people started to put it together, but we didn’t confirm or deny anything.

What was that first table read like when Troian finally came out as “A.D?”

People loved it. At that table read, I didn’t really know what to expect because Troian had to play Alex Drake and Spencer, and so she was playing these scenes with herself at the table read. People were on the edge of their seats and I knew it was going to work. Even the table read wasn’t easy to pull off.

Spencer’s parents didn’t know she had a twin, correct?

That is correct. Veronica and Peter did not know.

Mona is always so hard to read, but should we believe that she was actually always on the Liars’ side for this season?

Definitely for the first two seasons, she was “A.” But then I think she wanted to be Hanna’s friend in these final seasons.

Can you speak to Mona’s final scene when she had Alex and Mary Drake in the dollhouse in France? What should viewers take away from that?

We really just wanted to give the story a twist on a twist, and I really wanted to give Mona a happy ending and something that honestly was just really fun. She always loved France, she was always playing those records, so it makes sense that she would go to France with her hottie and play grown-up dollies with these two characters.

Spencer’s sister, Melissa, was always a fan-favorite theory to be “Uber A.” Can you explain what her involvement was in all of this, if at all?

She killed Bethany Young. Melissa was responsible for that murder, but she did it to protect her sister. But other than being a greedy older sister, that’s really her only thing — she really wasn’t that evil.

All of the couples end up together in the end — was that always the plan?

It really was. I’m a total romantic at heart. The path was bumpy and curvy, but I always knew these couples would end up together. The relationships are so important to our fans and they were so patient, so I thought it was really important to give them that.

The finale alludes to Spencer and Toby being together, but in your mind, what are they doing right now?

They’re living in the city and he’s building houses for homeless vets, and she’s commuting to Rosewood because she’s an attorney now working at Hastings & Hastings with her mom. And they’re engaged.