Charli XCX took a break from touring Wednesday night to perform at an unlikely venue: a high school gymnasium.

The chart-topping 22-year-old pop star delivered the tunes "I Love It," "Fancy" and "Boom Clap" to a crowd of excited high school students at Aspire Pacific Academy's homecoming dance. She later manned the DJ booth.

"Homecoming dances and proms are an American thing I've always been very fascinated with because all of my favorite movies end with a prom or something like that," said Charli, who was born and raised in England. "I was really excited because I thought it was going to be like my own `Jawbreaker' moment."

Watch Charli XCX Perform All of ‘Fancy,' Even Iggy Azalea's Verses

The special homecoming takeover was sponsored by Ubisoft, the video game developer whose recently released "Just Dance 2015" features tracks from Charli. Ubisoft decided to host the "Fancy" dance at Aspire Pacific Academy because of the charter school's commitment to performing arts and higher education.

"When I got a feel for how big this was going to be, I pretty much gave all artistic license over to them because I knew it was going to be big and fun," said John Zapata, the school's principal, who broke the news to students that Charli XCX would perform in their gym. "We're a small charter school. We don't have the resources to do a dance like this. We don't even normally have homecoming."

The event also included appearances by 17-year-old actress Bella Thorne and 25-year-old YouTube sensation Tyler Oakley, who joined students for a round of "Just Dance 2015" before crowning the homecoming court.

Charli XCX: The Billboard Cover Shoot

"It was really unexpected because they're really famous people," said 16-year-old attendee Samantha Alanis, who was honored as the junior homecoming princess.

Before the performance, students snacked on doughnuts and milkshakes, posed for photos on a red carpet and grabbed "Just Dance" swag. However, they were most interested in attempting to snap selfies with Charli, who happily smiled and flashed a peace sign for anyone who pointed their smartphone in her direction.

Charli's latest album, Sucker, is set for release Dec. 16.