'Dancing With the Stars' recap: In a stunning upset, Heather Morris earns a perfect score but gets voted off Bachelor Nick Viall brought in the lowest score of the evening, with a 28.

 -- On Monday night’s “Dancing With the Stars,” it was the men against the women for the first ever boy bands versus girl groups night, with the remaining eight stars strutting their stuff to popular vocal groups. Appropriately, Season 21 runner-up Nick Carter of the Backstreet Boys sat in for Julianne Hough as a judge.

It was an exciting night filled with splashy performances, but the up-tempo theme came to an end with the shocking elimination of “Glee” star Heather Morris.

Morris, a consistently strong performer who was a backup dancer for Beyonce, earned the first perfect score of the season with her returning partner, Maks Chmerkovskiy, for their rumba to “Waterfalls” by TLC. Carter said it was his favorite dance of the night. But jarringly at the show’s end, Morris was up for elimination, along with Nancy Kerrigan, and based on the combined tally of last week’s judges’ scores and viewer votes, Morris was voted off.

The reaction of the studio audience was deafening as they voiced their disapproval, but Morris handled it with grace and said she was happy to have had the chance to be on the show.

Hot on the heels of her high score was Fifth Harmony stunner Normani Kordei. She and her partner, Val Chmerkovskiy, enthralled the crowd and wowed the judges with an electrifying salsa number to “When I Grow Up” by the Pussycat Dolls.

Effortlessly sashaying, twisting, kicking and gyrating around a faux construction site, Kordei continued to mesmerize with her dancing. Judge Bruno Tonioli told her, “You blew my boxes!” She would have had a perfect score but for Len Goodman, who gave her 8 out of 10, for the second-highest score of the night, 38.

Bachelor Nick Viall brought in the lowest score of the evening, with a 28 for his jive with partner Peta Murgatroyd to “Fun, Fun, Fun” by the Beach Boys. Of his performance, Goodman said, “I wasn’t picking up good vibrations, if you want to be honest about it.”

The night’s performances concluded with team dances as the men faced off against the women.

Bonner Bolton, Rashad Jennings, David Ross and Viall — Team Boy Band — took off their shirts and danced freestyle to a medley of “Dancing Machine” by the Jackson 5, “You Got It (The Right Stuff)” by New Kids on the Block and “Best Song Ever” by One Direction. Their moves earned them a 33 out of 40. Simone Biles, Kerrigan, Kordei and Morris — Team Girl Group — followed with their freestyle performance to a medley of “My Boyfriend’s Back” by the Chiffons, “No Scrubs” by TLC and “Bo$$” by Fifth Harmony, beating the men by a point.

Next week’s show will feature a night-at-the-movies theme, with the stars trying to capture the spirit of various movie genres.

Monday night’s standout moment:

In spite of some strong individual performances and charm of the team dances, the show was upended by the surprising elimination of Morris after she earned a perfect score for her rumba.

Judges’ scores:

Heather Morris and Maksim Chmerkovskiy – 40

Normani Kordei and Val Chmerkovskiy – 38

Rashad Jennings and Emma Slater – 37

Simone Biles and Sasha Farber – 35

Nancy Kerrigan and Artem Chigvintsev – 33

Bonner Bolton and Sharna Burgess – 30

David Ross and Lindsay Arnold – 29

Nick Viall and Peta Murgatroyd – 28

“Dancing With the Stars” returns next Monday on ABC.