The guys perform Rebecca Black’s infamous “Friday” on the prom episode of “Glee.” (Adam Rose/Fox)

WaPo Team TV’s Emily Yahr blogs:

Every show set in high school gets a Prom Episode — however, in typical “Glee” fashion, this one came with some off-screen drama.

Several weeks ago, a woman who had worked as an extra on the show leaked the prom king and queen results on Twitter. The spoiler was widely circulated online, and co-executive producer Brad Falchuk fired off an angry tweet in response that was surprisingly mean for someone whose show preaches acceptance and second chances at every turn.

Anyway, for those who didn’t find out the results early, it’s doubtful you would have guessed who won the coveted McKinley High prom king and queen crown. “Glee” may not be a show for plot consistency or realistic characters, but it sure knows how to throw random twists that no one would see coming. Intriguing mysteries, or sloppy writing? It’s a question for the ages!

But before the big reveal, the New Directions members scramble with the two most stressful parts of prom -- finding a date, and finding the outfit. Dateless Mercedes is less than thrilled when also-dateless Rachel suggests they go together, but she doesn’t need to worry. Jesse St. James -- the guy who broke Rachel’s heart last season when he joined her rival glee club, Vocal Adrenaline -- boldly returns, making quite an entrance when he appears out of nowhere to help Rachel finish her performance of Adele’s “Rolling in the Deep.” Faster than you can say, “Wait, why is he back?” Rachel’s off the prom date market.

The other glee kids get matched up. Football captain Finn and cheerleader Quinn. Adorable couple Mike Chang and Tina. Still-closeted Santana and also-closeted football player Dave Karofsky. Etc. Artie tries to win back Brittany with a serenade of “Isn’t She Lovely” during cooking class. But she still can’t forgive him for calling her stupid in last week’s episode, which is just as well, because we can’t forgive Artie choosing such a lame song to sing to her in front of everyone.

Meanwhile, Kurt is going with boyfriend Blaine to prom, and decides to design an Alexander McQueen-style outfit as an homage to Kate Middleton’s royal wedding dress. His dad questions this fashion choice, and accuses him of stirring the pot, and warns him about others wanting to hurt him. Kurt brushes this off -- he hasn’t been bullied in awhile.

This may be thanks to the school security team that former bully Dave Karofsky agreed to start, in order for Kurt to feel safe coming back to school. While walking Kurt to class, Karofsky breaks down crying, and apologizes for terrorizing Kurt earlier in the school year. He even rips off his security team member red beret, so we know he’s serious.

That nice moment over, it’s time for the dance -- which, as most school dances tend to be, is a complete disaster. Points for high school realism! Finn can’t handle seeing Jesse with his ex-girlfriend, Rachel, and they get start punching each other. Artie gets hauled off to evil cheerleading coach/prom coordinator Sue Sylvester’s office after he spikes the punch with gin, on bad boy Puck’s orders, but all we can think about is how much he looks like Austin Powers in his red tuxedo and glasses.

But that’s nothing compared to the moment that prom king and queen is announced. Principal Figgins takes the stage to award the king crown to Karofsky. And who is named queen? None other than Kurt. Cue stunned silence, and Kurt running off, crying.

While Kurt is devastated, Quinn is also sobbing after her boyfriend Finn’s fight with Jesse, and Santana is quite upset that she didn’t win prom queen. Though the three of them are all very sad, they have another song to get to, so things are healed quickly.

Quinn slaps Rachel in the face, which seems to make her feel better, and confesses she’s scared about the future. Brittany gives Santana a pep talk and says she’s awesome. And Kurt, after explaining he thought there was real change at this school, decides he won’t let anything get him down -- he marches back out there, accepts his crown, and announces, “Eat your heart out, Kate Middleton!”

And then everyone dances to ABBA’s “Dancing Queen,” balloons fall from the ceiling, and everything seems to be magically healed. So, a pretty typical ending, though in fairness, there’s nothing a good ABBA song can’t fix.

Oh, and did we mention the glee club is tasked to perform at prom? The principal’s first choice band can’t make it, so the New Directions fill in to raise money for the Nationals competition. The highlight is a rousing rendition of Rebecca Black’s “Friday,” the teenage, heavily-autotuned YouTube sensation with more than 136 million views, and widely considered one of the worst songs of all time. And yet, strangely catchy. Go figure.

And for all those who enjoyed the episode, spoiler free or not, let us remind you that this was just “Glee’s” junior prom -- meaning, another prom episode next season.

Set list:

“Rolling in the Deep” - Adele

“Isn’t She Lovely” - Stevie Wonder

“Friday” - Rebecca Black

“Jar of Hearts” - Christina Perri

“I’m Not Gonna Teach Your Boyfriend How to Dance With You” - Black Kids

“Dancing Queen” - ABBA