PARK CITY, Utah — One song holds a special place in Lupita Nyong’o’s heart: “Shake It Off” by Taylor Swift.

“‘Shake It Off’ means a lot to me,” the “Black Panther” star told the audience at the Sundance Film Festival Tuesday after a screening of her new comedy “Little Monsters.”

In the film, Nyong’o plays a kindergarten teacher who needs to protect her students from a zombie invasion. Her character, Miss Caroline, sings the song “Shake It Off” while strumming a ukulele, to keep the kiddos calm and happy. And it was the Oscar-winning actress who helped get her favorite tune in the movie.

“I was going through a hard time professionally, and I was just in a funk,” she said. “I was working abroad, and my best friend came to cheer me up. He played ‘Shake It Off’ on his phone, and we just had a dance party in my bedroom.”

“It meant a lot to me that this film had that [song],” Nyong’o added. “And so when I heard that they were having a hard time [getting the rights] I wrote Taylor Swift myself and asked her, and told her that story. And she said yes!”