Following a series of "Toy Story" themed billboards with the letters "TS" on them, a "Toy Story"-themed countdown also appeared on Swift's official website on Monday leading up to the announcement.
The new song, titled "I Knew It, I Knew You," is set be released on June 5, Swift revealed in an Instagram post Monday.
"I've always dreamed of getting to write for these characters who I've adored since I was a 5 year old kid watching the first Toy Story movie," she wrote in the post's caption. "I fell instantly in love with Toy Story 5 when I was lucky enough to see it in its early stages, and I wrote this song as soon as I got home from the screening."
She added, "Sometimes you just know, right?"
"I Knew It, I Knew You" is available now for pre-order on Swift's official website.
"Toy Story 5," premiering in theaters June 19, sees the iconic toys Woody (Tom Hanks), Buzz Lightyear (Tim Allen) and Jessie (Joan Cusack) coming face-to-face with new nemesis Lilypad (Greta Lee), a frog-shaped tablet.
Lilypad arrives with her own disruptive ideas about what is best for their kid, Bonnie, according to a press release.
The voice cast also includes Conan O'Brien, Scarlett Spears, Shelby Rabara, Mykal-Michelle Harris, Craig Robinson, Bonnie Hunt, Lori Alan, Jay Hernandez and John Hopkins.
Wallace Shawn, Kristen Schaal, Blake Clark, Tony Hale, Jeff Bergman, Anna Vocino, Ernie Hudson, Krys Marshall, Jerome Ranft, Melissa Villaseñor, Annie Potts, Matty Matheson, John Ratzenberger and Keanu Reeves also lend their voices to the film.
Along with Swift, another musical artist joining the film is Bad Bunny, who plays the role of Pizza with Sunglasses. The "DtMF" singer's cameo character is described as "effortlessly cool and mysterious" and "a member of a small but mighty community of forgotten toys that live in an abandoned backyard shed."
"Toy Story 5" is directed by Andrew Stanton, who previously helmed Disney and Pixar's "Finding Nemo," "WALL-E" and "Finding Dory."
Disney is the parent company of Pixar and this station.