Miley Cyrus hosted a holiday special on NBC, with comedian Pete Davidson as her co-host. The event was a success, with fantastic performances from artists including sister Noah Cyrus, Saweetie, Jack Harlow, and more.

But of course, Miley herself took the stage for some live performances. And during her set she ran into a slight wardrobe malfunction.

While singing "Party in the USA," she was wearing a silver halter which has a matching mini skirt. And before the first chorus hit, she was already struggling to keep it on.

MILEY’S NEW YEAR’S EVE PARTY HOSTED BY MILEY CYRUS AND PETE DAVIDSON -- Pictured: Miley Cyrus performs on Friday, December 31st -- (Photo by: Vijat Mohindra/NBC)

While singing Party in the USA, she was wearing a silver halter and a matching mini skirt. Even as she started the song, she was struggling to keep the top on. Despite her struggle, she pulled it together and made it through all of her songs.

At the end of her performance, she flashed her bra to the camera. And being the entertainer that she is, she decided to turn it into a joke. She said:

"I wanted to convey I was having fun, until this: "I wasn't nervous — until this," and then flicked off the camera.

She then changed into a gold top with fringe, leaving her belly button exposed. But she wasn't done there, as she also wore colorful leggings and boots. Miley Cyrus' career has been on an upswing since her release of Younger Now. This album follows her Party in the USA album, which was released six years ago. And this year she has joined the Happy Hippie Foundation to help homeless and LGBTQ youth. She also released a new single called "Nothing Breaks Like a Heart" on December 7th.Miley Cyrus' holiday special on NBC topped the ratings, with nearly 4 million viewers tuning in to watch her perform some of her hits.