The semifinals of ABC’s “Dancing With the Stars” turned unexpectedly emotional Monday, as actor James Van Der Beek revealed he almost dropped out of the night’s competition because his wife, Kimberly, had a miscarriage several days ago. Then, at the end of the episode, the judges chose to eliminate Van Der Beek when he was pitted against singer Ally Brooke in the bottom two — which prompted Brooke to break down sobbing and start begging to give her slot to Van Der Beek.

“Can I give it to James, please?” Brooke wept to host Tom Bergeron. His co-host, Erin Andrews, was also in tears.

“No, no,” Bergeron said gently, trying to comfort her. “That’s lovely of you to say that.” Brooke ran over to Van Der Beek and urged him to take her place. “Please, please,” she cried.

Van Der Beek smiled and shook his head. “You’re going to go crush it,” he told her. As the credits rolled, Brooke’s professional partner, Sasha Farber, and the rest of the cast surrounded them for a group hug. Brooke will compete for the Mirror Ball Trophy in Monday’s season finale against singer Lauren Alaina, actor Kel Mitchell and “The Bachelorette” star Hannah Brown.

As emotions were already running high, the controversial decision to save Brooke prompted an angry outcry from fans on social media. The hashtag #DWTS was a top Twitter worldwide trending topic for hours. Many were extremely upset that Brooke was still in the running, both because they felt Van Der Beek was a better dancer — and the judges already saved her from elimination twice this season.

Although Brooke has been a favorite of the judges, edging out Van Der Beek and Brown for the highest overall average score, Van Der Beek still remained the front-runner. Last week, oddsmakers declared the “Dawson’s Creek” star as the safe choice to win; prediction website GoldDerby also had him as No. 1. But as the comments raged, others pointed to Brooke’s kind gesture at the end of the show.

Later, Brooke told “Entertainment Tonight” that although she has had “the time of my life” in the competition, she truly felt Van Der Beek deserved to go to the finale. “I don’t believe it’s fair that he was sent home, so I just wanted to give my spot to him,” she said. “He’s been through so much, and he’s overcome so many things. Especially this past week, I just felt it was right to give it to him. Obviously, he didn’t accept it. I talked to him and he was proud of me. He told me, ‘Don’t be afraid to shine.’ ”

At first, Monday seemed like just a regular episode, as each couple performed two dances. But when the judges offered criticism about Van Der Beek and partner Emma Slater’s cha-cha, Bergeron broke in. “I want to just allude to something. I know you’ll talk to Erin about it later, but this has been a tough week for you,” he said. “That could have been a complicating factor here.”

Right before they started their second dance, Van Der Beek — who told viewers in October that he and his wife were expecting their sixth child — elaborated in a prerecorded statement. “My wife, Kimberly, and I went through every expectant parent’s worst nightmare. We lost the baby,” he said, and started to cry. “The little soul that we had expected to welcome into our family took a shortcut to whatever lies beyond. You never know why these things happen. It’s what I’ve been telling my kids. All you know is that it brings you closer together. It breaks you open. It opens up your heart. Deepens your appreciation. Makes you more human.”

“I really didn’t think I would be dancing tonight,” Van Der Beek continued. “But Kimberly from her hospital bed said to me, ‘I’m not done watching you dance.’ … Kimberly, I’m dancing for you. I’m dancing for us.”

After he and Slater completed their fox trot, they both broke down weeping on the dance floor. Judges Carrie Ann Inaba, Len Goodman and Bruno Tonioli were also shaken. “James, when tragedy strikes, it puts everything into perspective. And this is just a dance show,” Goodman said. “For you to come out and dance with so much feeling and emotion, I admire you so much. Well done.”

Van Der Beek’s young daughter started crying in the audience; when the actor noticed this, he walked over to pick her up and carry her to the stage where he waited for the judges’ scores. Andrews held up the microphone to Van Der Beek, who was still cradling his sobbing child. “I feel like scores are absolutely pointless at this point, but we’ll get them for you,” said Andrews, who was almost too choked up to speak.

The deeply emotional scene, however, led to the upsetting final moments. Bergeron announced Brooke (who landed a perfect 30 and almost-perfect 29 for her two performances, with the judges declaring her dancing “magical”) was in the bottom two against Van Der Beek. Due to new rules this season, viewer votes and judges’ scores determine the bottom two, and then Inaba, Goodman and Tonioli decide whom to send home.

Inaba was first. “This is not easy. First of all, this is not at all what I expected to see here. You both are amazing. Both couples are fantastic,” she said, and paused for a long time. “The couple I want to save, and I’m so sorry, is Ally and Sasha. I’m so sorry, James.”

Tonioli sadly concurred. “It’s incredibly hard. You’re all winners. You’ve all given fantastic performances,” he said. “This is very hard. We have to make a decision based on the season. And for that reason alone, I have to say Ally and Sasha.” (Goodman only votes in a tie, and he said he would have chosen Brooke.)

Social media immediately lit up with anger. Earlier in the episode, before she performed a complicated Charleston routine that earned her 30 points, Brooke — who said she previously faced bullying as the “worst” dancer in her former girl group Fifth Harmony — expressed doubt that she would remain on the show if she was in the bottom two once more.

“If I’m in the bottom two again, I don’t think they’re going to save me. So the pressure is on. There’s no room for error,” she said. “This dance has to prove why I deserve to be in the finale.”

Read more: