The performance came after host Jimmy Fallon commented on the attack stating, "In the face of tragedies and acts of terror, we need to remember that good still exists in this world. We're here to entertain you tonight and that's what we're going to do."
Cyrus was joined onstage by Sandler who also a guest on The Tonight Show, as the comedian played the guitar and joined the pop star on vocals.
Following the performance, Cyrus explained to Fallon why she chose to open the show with "No Freedom."
"There is no love without freedom, and I think about that when these tragic events happen," she said referencing the songs lyrics. "What is music if we can't go see our favorite artists perform because we're scared of violence or we're scared of losing someone that we love.... We're supposed to be the land of the free but we can't have freedom if we're constantly living in fear."
On Instagram, Cyrus thanked Sandler for joining her onstage alongside a photo of the pair performing. "Thank you so much to Adam Sandler for joining me tonight in remembering all those lost, and singing lyrics that I believe are so important at this time .... #LandOfTheFree #StopTheViolence #GivePeaceAChance," she wrote.
Cyrus will be featured on The Tonight Show throughout the week while Sandler was on hand to promote his new film The Meyerowitz Stories.