Elphaba (Cynthia Erivo, left) and Glinda (Ariana Grande) in "Wicked: For Good."
The original logo for the stage musical "Wicked."
During a flashback scene, Elphaba (Cynthia Erivo, left) and Glinda (Ariana Grande) hang out in a poppy field.

Spoiler alert! The following post contains major details about the ending of “Wicked: For Good” (in theaters now). Stop reading if you don’t want to know what it is.

We all figured we’d be a sobbing mess by the end of “Wicked: For Good.”

But we also couldn’t be happier with the film's heartwarming final image, which director Jon M. Chu perfectly deployed to bring a smile to every theater kid’s face.

Similar to the Broadway musical, the new movie ends with Elphaba (Cynthia Erivo) and her strawman swain Fiyero (Jonathan Bailey) walking into the sunset away from Oz, after the revelation that Elphaba staged her own melting death by hiding under a trapdoor.

But before she ventures into the desert, Elphaba turns around and sings one last reprise of “For Good” with her far-off friend Glinda (Ariana Grande), who has been entrusted to take care of Elphaba’s ancient spellbook, the Grimmerie.

The film then flashes back to Glinda and Elphaba’s college days, as the girls sit in a poppy field wearing a white knit shawl and black pointy hat, respectively. And in the last shot of the movie, Glinda turns to whisper something in Elphaba’s ear – lovingly recreating the iconic logo for the Broadway musical.

When they filmed the two-part movie, the cast was unaware of how and when that scene would be used.

“I had no idea,” Erivo tells USA TODAY. “We had shot this wonderful day of moments together (in a field). Jon said he was going to use it somewhere, but he wouldn’t tell me where. Then when I saw the film, I was like, ‘Oh, my God, that’s where it is!’ ”

How the end of 'Wicked: For Good' honors the Broadway show

Very early on in the development of the movies, Chu knew that he wanted to include the whisper somewhere.

“That’s the most iconic thing of ‘Wicked,’ ” Chu says. “There is no context in the show about it, but it’s so powerful. The mystery of what they’re saying is so fascinating. I just thought, ‘It’s a brilliant poster, like, genius. Let’s put that into practice.’ "

For a while, he tried to incorporate the whisper into other parts of the story, but “it never quite worked,” Chu says. “It always felt a little performative.”

But then, screenwriter Winnie Holzman came up with the idea of a montage where Elphaba and Glinda go poppy-picking on a hillside with their classmates at Shiz University. Together, they stroll and laugh through a field, before Glinda rests her head on Elphaba’s shoulder.

“I loved the idea of seeing them all as friends before fate tears them apart,” Holzman says. In early drafts of the script, composer Stephen Schwartz had even written a new song “for them all to sing as they’re having this idyllic outing together.”

The picnic sequence was ultimately cut from last year's "Wicked" Part 1, although some of the footage – including the whisper – finds its way into flashbacks of “Wicked: For Good.”

Chu remembers filming that scene just as the sun was going down. Spontaneously, he asked Grande to lean over and try whispering something in Erivo’s ear.

“I didn’t know exactly where it would go, but I thought, ‘That’s interesting,’ ” Chu recalls. “It felt like a natural way that you would hang out with a friend. But then once we had it in the can, I was like, ‘Oh, this has got to go at the end of the movie.’ It’s just such a beautiful moment.”

This article originally appeared on USA TODAY: Cynthia Erivo 'had no idea' that would be the 'Wicked 2' final shot

Reporting by Patrick Ryan, USA TODAY / USA TODAY

USA TODAY Network via Reuters Connect