[Warning: This story contains spoilers from the "Live. Live. Live." episode of ABC's How to Get Away With Murder.]

The midseason finale of ABC's How to Get Away With Murder historically builds to a tense climax, finally revealing what exactly happened in the moment each season flashes forward or back to. And in true HTGAWM fashion, season four's big reveal Thursday was no less dramatic.

It turns out that the team's law school nemesis found out that they were up to no good, but accidentally shot himself in a scuffle at the firm where Michaela (Aja Naomi King) is interning. But that's not even the craziest part: Laurel (Karla Souza) then gave birth prematurely in the elevator of Annalise's (Viola Davis) apartment building, with Annalise (Viola Davis) stumbling on the bloody scene, pulling the tiny premature baby through the elevator gate and giving the newborn CPR as she waited for paramedics to arrive.

Here, HTGAWM showrunner Pete Nowalk talks with The Hollywood Reporter about coming up with this season's mystery, exec producer Shonda Rhimes' input, and the show's declining favor among critics and viewers.

The graphic ending, especially Laurel's ordeal in the elevator and Annalise giving the baby CPR, how much do you think about the impact for the audience? When you're writing toward something like that, how surprising do you want it to be for the audience?

I don't get that hung up on the surprises, and actually this season, when we started we had a good sense of what was going happen. Usually I just believe that — I never knew who was under the sheet until the last minute, but this season it's like, I just wanna know what we're going towards. So, you saying you were surprised is surprising to me because I wasn't. It's what we planned from the beginning. We built that whole thing with Laurel in the elevator and the gate, we put a gate on the elevator just for that. That was all designed from the beginning. I never know whether people are going be surprised or not. I more just know that that's what I think happened. I want people to find it believable and stuff, or not be surprised to the point that they don't believe it, but it's so out of my control. I have no perspective on how you all watch the show. Like, I think you're going to be shocked and you're not and vice versa.

Those last few moments, beginning when the gun went off, seemed to be coming together in a very How to Get Away With Murder kind of way. But that elevator scene with Laurel and then Annalise with the CPR was definitely one of the most dramatic things ever seen on your show. Would you agree?

It's one of those things you're like, 'Oh yeah, Laurel's gonna have the baby in the elevator and Annalise is gonna have to pull it through the gate.' It's like, 'OK, we're going to do that.' And then you write it and all that stuff and then honestly, Karla Souza I just was so impressed with. We actually had a version of the show we wrote where we cut back and forth between her and the elevator and I just found her performance so gripping and horrifying and nauseating that I didn't want to leave it. So we actually re-edited it just so she played every moment of that in real time. I was shocked by what I saw too. I still am every time I see it and I know it's really uncomfortable for people but I found that very — any time I'm shocked I'm like okay, 'I want more of this.'

That was a heavy moment, which you followed with an almost surreal scene of Annalise coming and pulling the baby through the gate. Then you have Viola Davis performing CPR on this tiny little baby doll. What are the conversations with Viola like when you pitch her this insane thing?

I have the easiest job in the world because when I pitch her these things, she's like, 'I like it.' She's so not phased by anything. But I think ultimately why we've done this is really Annalise has her own scars about losing her own child. So it really did just feel like it comes full circle, which she thinks is Wes's baby. So it felt like a no-brainer in terms of she would want this baby to live, and I really actually love watching her do something heroic. Just pure emotional heroism. Do you get notes from Viola on stuff like that? Yeah. That I didn't, though. She's so un-phased by everything. She's very chill. She'll just say, 'Oh, I like that I get to save the baby's life.' I think she liked doing something different. But yeah, we collaborate all the time. I rely on her opinion all the time. So if she doesn't like something, I'll try to make her like it because she's really my number one audience person.

What are the notes from the network and studio, especially with something, for example, as crazy as this episode ending?

They're really supportive. I'm actually, as a person, very scared of things and I think working for Shonda for so long made me try to take bigger risks. I've always just tried to go to sleep at night just saying, 'Do the thing that's risky, and do the thing that's a big swing, and don't take this for granted and do something boring.' I'd rather go down with a big bang than with a little whimper. So they have always been very supportive of the crazy of the show. Clearly, that's what they put on the commercials.

How involved is Shonda in the show these days?

She watches it and I'll go to her when I will need help or I need an opinion but she's pretty hands-off these days and she's one of my biggest fans and one of our show's biggest fans. So it's really nice because obviously I respect her opinion. She's done so many crazy things on her shows, though, so I feel like nothing we do is ever going to shock her.

You mentioned before that you knew how this would all piece together, which is different than how you'd done it in the past. How much has your process changed over the course of the four seasons? Do you write toward an end game every season?

Definitely in the middle of the season — You know, what I'm tired of is not knowing. Sometimes it's worked well and sometimes it's probably gotten more criticism in terms of the puzzle of it. The first season we had so many pieces, we saw so many flash-forwards, and it was fun, but I was exhausted. I think at this point I just try to know a little bit more and back ourselves into a corner less just in terms of being able to have the stamina to always figure out how the puzzle comes together. It's not any easier than it was, honestly, but I'm just trying to make it. Sometimes I'm like, 'what's the simplest version?' And we go with that.

The show has looked very different over the four seasons in terms of how you've played with the structure. What do you think of the response to this season in particular?

I don't know what the response is. I don't read any of the things.

Considering everything that's happening politically in our country and the insanity of this industry, and you have this show that's about lawyers, do you consider kind of tackling some of those issues and making it politically relevant?

I feel like doing the class-action this year, we're we're deal with that more, but the emphasis for Annalise taking on the justice system — really she's suing the entire justice system — it's a little bit about that, but we've always tried to integrate social issues that we care about or that I find I'm learning about and I'm like, 'Ooh, let's put this in the show.' For me, even since the show started, the world has changed. Obviously the country has changed so much. I get why there's shows where people are heroes and are doing well and where it's nice because I feel like I want that too. But for this show, I'm just trying to stick to the point of view that we have of these characters and they don't exist in a Trump world. Trump doesn't exist on the show. I think of it more like I'm making this for the long term. So someone might view it in a completely different political environment and will apply then. Only if it makes sense for the character, I guess, versus trying to make a big statement about the here and now. I don't know when people watch it. People don't watch it live. I hope they watch it in 20 years, that's my goal.

You do touch on social issues, particularly the Oliver/HIV positive storyline, which hasn't been mentioned on the show recently. Is that something that you plan to explore further?

I don't know. A lot of people ask me that question. I think it's a great question. We do mention it when I think it's appropriate. Like, Connor mentioned it with his father because he thought his father didn't like Oliver because Oliver was positive. They're both on Prep. But, really, what's fascinating to me is the stigma of HIV is still very relevant in the world. I don't think with the characters on the show — they're murdering and stuff, so the stigma of Oliver having HIV is sort of a big nothing. Which to me means a lot. I want it to be a big nothing to people as long as you can get proper treatment. It doesn't have to be a big deal for the characters and people who are getting treated. I think to me the Oliver story isn't just about that, it's just one of the many, many millions of characteristics about him. I think that's sort of my point.

Do you have a long-term plan for the show? Do you know how the show itself ends?

I think about it, especially since we're in season four. I don't know how much longer we'll go. I don't think anybody does. Yes, I definitely think about the last season and I have a vague idea of [what will happen]. We always have a question and I definitely have a question for the last season, but it's going to depend on where I want see Annalise end up and what I want to happen to her, so I won't know, I guess, until we get there.

Ratings though have been off considerably. Are you concerned by that?

I don't know if I'm concerned. I definitely wish everyone and their mother watched the show, of course. People don't really talk to me about it. You're the first person. You know the live plus sevens are always really good. We go up a ton [with DVR]. I don't know if people watch it live. I know my trainer's like, 'I need to binge them all at once.' I'm just trying to make each episode as good as it can be and then maybe in 20 years someone will watch it, maybe they won't. But I'm not chasing the ratings as much as I'm just trying to maintain some quality. I think if you watch these actors and what they're doing, whether or not the show is for you, I think you can't help but admire their performances and the depth their bringing. I'm pretty proud of that.

The baby cried at the end of the episode. What can you say about where the story goes from here?

We're going pick up in the immediate aftermath of that night, where the paramedics are about to arrive. The baby is really premature and Laurel is waking up and screaming, 'Where's the baby?' Normally, we would've answered that before the mid-season finale, but we have one less episode to air because of where Thanksgiving fell, so you'll find that out in the premiere.

How to Get Away With Murder returns in 2018.