Miley Cyrus nearly showed more skin than she intended on New Year’s Eve.

Friday saw the 29-year-old musician host a television special to ring in the new year called “Miley’s New Year’s Eve Party,” which also featured musical performances from the star.

While performing onstage, Cyrus wore a small silver top that began to come loose as she was singing “We Can’t Stop.”

Cyrus then transitioned into her song “Party in the U.S.A.,” though the performance didn’t last long, as she had to quickly grab her top to keep it from falling off.

MILEY CYRUS VISITED PETE DAVIDSON’S STATEN ISLAND CONDO AFTER ‘FALLON’ LATE-NIGHT APPEARANCE: REPORT

Miley Cyrus suffered a wardrobe malfunction during her New Year's Eve special "Miley's New Year's Eve Party."

Miley Cyrus suffered a wardrobe malfunction during her New Year’s Eve special “Miley’s New Year’s Eve Party.” (Getty Images)

The star hurried off the stage while her band and backup singers continued to play.

When the star returned to the stage just moments later, she was no longer wearing the silver top, but a bright red blazer that she’d worn earlier in the night.

“I’m still in the most clothes that I’ve ever worn onstage,” she added in between lyrics of “Party in the U.S.A.” when she resumed her vocals.

Pete Davidson and Miley Cyrus onstage during their New Year's Eve special.

Pete Davidson and Miley Cyrus onstage during their New Year’s Eve special. (Getty Images)

“Thank you so much, everybody, thank you,” Cyrus said at the end of the show. “Tonight’s show was all about being flexible, rolling with the punches, and making the best out of even the worst circumstances. And that resilience shouldn’t end here. Let’s bring that into the New Year with us.”

She continued: “We’ve all learned how to expect the unexpected, and rather than see it as a problem, let’s see it as an opportunity. I wish everyone here in Miami and everyone watching from home a happy and healthy 2022.”

Miley Cyrus and Pete Davidson hosted "Miley's New Year's Eve Party" on Friday to ring in the new year.

Miley Cyrus and Pete Davidson hosted “Miley’s New Year’s Eve Party” on Friday to ring in the new year. (Getty Images)

“Thank you for making tonight possible,” the star concluded. “You were really all that I needed to have the ultimate party.”

The special, which was held in Miami in front of a vaccinated audience, was co-hosted by “Saturday Night Live” star Pete Davidson.