On Tuesday night, "Glee" paid homage to the late Whitney Houston. But Amber Riley's soulful rendition of "I Will Always Love You" had already been on the docket for the Valentine's-themed episode, titled "Heart," long before Houston was found dead Saturday in her Los Angeles hotel room.

While the song choice served to move along the plot — which revolved around the love triangle between Riley's Mercedes and her two beaus, footballer Shane (LaMarcus Tinker) and fellow Gleek Sam (Chord Overstreet) — it was particularly stirring, considering its timing.

Standing in a red gown, Riley stood alone on a stage with just a spotlight on her as she sang a pitch-perfect rendition of the song, a Dolly Parton track recorded by Houston for "The Bodyguard" soundtrack. While Riley sings, Overstreet stands in the back of the auditorium, acknowledging her tearful goodbye to him.

Who covered "I Will Always Love You" better: "Glee" or the Grammys?

The show's producers acknowledged the icon's loss with an "In Memoriam" slate that ran at the end of the episode, which simply read: "Whitney Houston 1963-2012. We will always love you."

The decision to acknowledge the singer's death was made shortly after the news of her tragic and untimely death broke. "Obviously, we could not predict the unfortunate circumstances that happened this weekend," "Glee" music supervisor P.J. Bloom told The Hollywood Reporter. "But at the same time, instead of focusing on the dark stuff, it's nice to have an opportunity to hear her in this way and celebrate the magic that Whitney brought to this industry."

Riley opened up to E! News about meeting Houston on Thursday, at the pre-Grammy party where Whitney hit the stage with Kelly Price. "Whitney's music meant so very much to me. I was very, very choked up when I heard about her passing. I just met her this past Thursday," Riley said. "I've grown up listening to her voice ringing throughout our household. I'm so speechless. I can't believe that she passed."

On Sunday, Jennifer Hudson performed the same song at the Grammy Awards, serving as a simple, emotional tribute to the singer.

Tune in as we celebrate the life of an icon with "Whitney Houston: In Her Own Words" tonight at 7:30 p.m. ET on MTV.