"HalloVeen" included a few big surprises, but what's never surprising is how well this show works.

[Editor’s note: Spoilers for “Brooklyn Nine-Nine” Season 5, Episode 4, “HalloVeen,” follow.]

If you were looking for further proof that “Brooklyn Nine-Nine” is one of the best comedies on television, “HalloVeen” was it. From the cold open of the episode, the show crackled with energy, letting the lighthearted heist competition that’s become a yearly tradition drive the pitch-perfect interactions of the ensemble.

Throw in probably the only good jokes we’re going to hear this fall about “The Handmaid’s Tale” (‘It’s relevant as hell!”) and the unending joy of Captain Holt (Andre Braugher) dismissing a corgi far inferior to his own beloved Cheddar as an “idiot,” and even before the pivotal final minutes this episode was pure joy.

The only disappointment from the actual heist portion of the episode: Andre Braugher saying “cummerbund” is not as funny as Andre Braugher saying “caboodle” during last year’s Halloween heist. (Though “in my belly!” from the opening sequence does lessen the sting to a great extent.)

Meanwhile, “HalloVeen” also featured a big moment for what’s become the show’s central couple, as Peralta (Andy Samberg) (finally!) proposed to Santiago (Melissa Fumero). While the pair have been dating since approximately Season 3, and recently moved in together, the question of marriage between them always seemed to come second to the cases being investigated and the trouble they landed in.

It was thus extremely appropriate that Jake’s proposal ended up taking precedence over everything, including the actual heist itself (much to Holt’s dismay). There was no official winner of the fifth annual heist, except for fans of romance.

It’s worth noting that the Michael Schur-verse has precedent for taking Halloween and making it an occasion for engagement: “Parks and Recreation” literally did this with the episode “Halloween Surprise,” which segued from Leslie (Amy Poehler) thinking that she and Ben (Adam Scott) were about to put their life together on hold to Ben surprising her with a seemingly spontaneous engagement ring.

In the case of “Brooklyn Nine-Nine,” though, there was nothing spontaneous about Peralta’s plans, as he revealed at the end of the episode — tracking his decision to propose to one tiny moment six months in the past, as seen in a flashback. There’s a touching quality to Samberg’s performance in that scene, a sense of dawning maturity that speaks to how much the character has progressed over the years. It’s the sort of moment that makes following a TV show over the seasons feel truly rewarding.

What’s become so fun about watching “Nine-Nine” evolve from its first season is that it’s a show that has allowed its characters to grow, change, and evolve. The plotlines still dart between the silly, the emotional, and the serious, but they do so in the service of making the show feel richer and more lived-in.

Any savvy TV viewer knows better than to think that Amy and Jake will have a smooth path to the altar, either for interpersonal reasons (the two characters do have plenty of differences) or because always present is the fact that this is a show about cops, and sometimes real police work interferes with the fun.

And after five years, the show has figured out just how to make sure all of those elements work together — just like the oddball cops of the 99th precinct, who started off as co-workers and now feel like a family.

“Brooklyn Nine-Nine” airs Tuesdays at 9:30 p.m. ET on Fox.

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.