Miley Cyrus nearly had a panic attack at Milwaukee’s Summerfest. By the end of the night, it was ‘the greatest concert in the world.’

She set the tone with the unapologetic “be you” anthem “We Can’t Stop,” slipping into a piercing snippet of Pixies’ “Where Is My Mind?” (a swell consolation for any fans there bummed about their Summerfest cancellation).

A few songs later, she was pushing her powerful, husky pipes to their limit with a shattering cover of Blondie’s “Heart of Glᴀss.”

Then a few songs after that, the curled tongue was out and she was back in her “Bangerz” mode — and rapper Wiz Khalifa, her opener Friday, was by her side — with the pair hugging and strutting through their towering collaboration “23.” (Khalifa was in such a generous mood he even tossed the rest of his blunt to a fan in the crowd.)

But soon after that, Cyrus confessed something incredibly personal to the nearly 20,000 people packed into Summerfest’s American Family Insurance Amphitheater.

Between one long pause between songs, she said she had told her drummer and musical director Stacy Jones, who has played with her since she was 12, that she thought she was having a panic attack.

“Like everyone else, for the last year and a half I have been locked away and isolating and it is very stunning to be back in a place that used to feel like second nature. Being on stage used to feel like home, and it doesn’t anymore because of how much time I spent at home locked away,” Cyrus said.

“The pandemic was startling and terrifying and coming out of it is slightly terrifying,” she continued. “So I just wanted to be honest with how I’m feeling.”

Not since Stevie Wonder wept over the death of Michael Jackson just a few days prior at his Summerfest show in 2009 can I recall a performer being so emotionally transparent with their audience at the Milwaukee music festival.

And it was even more remarkable coming from someone like Cyrus, an artist who’s lived through an alter ego practically her entire life, from “Hannah Montana” to her hip-hop phase to her folky “Malibu” period to her current, glam rock-embracing “Plastic Hearts” persona (complete Friday with feathered ’80s-style hair, and sequin-studded skimpy purple top, skirt and knee-high boots.)

But it was clear Friday that she was done pretending, and being so open relieved her of a burden.

“The last year kind of removed this divide, this curtain, and we’re allowing people to see us in our most vulnerable, our most isolated, our most hurt, our most scared states,” Cyrus said during her five-minute speech. “And I think that’s something really empowering … “

“I think by being honest, that makes me less afraid,” she continued. “I’m getting used to being back on stage, but there’s nowhere else that I’d rather be.”

And from there, a show that was already dazzling became even more stunning, the newly liberated star at the center visually empowered by the support of her fans.

Cyrus took on the intimidating task of covering Janis Joplin’s “Maybe,” singing with nearly as much fire in her voice as the late legend herself. “7 Things” was a pop-punk powerhouse, the 13-year-old track feeling as abrasive as ever, accompanied by an eight-piece band and striking visuals of teen girls with scars and blacked-out eyes, clutching stuffed animals, screaming and crying blood.

But after that, the band receded, leaving just Cyrus, under a lone spotlight, belting with gripping anguish over sparse electric guitar for a cover of Cher’s “Bang Bang (My Baby SH๏τ Me Down).”

“Midnight Sky” — the single from her latest album, “Plastic Hearts” — was a soaring triumph, with Cyrus’ voice and raw delivery striking like lightning. “The Climb” came after that, the “Hannah Montana” anthem that continues to carry incredible weight with this full house, with the fans’ sweet voices surrounding Cyrus’ vocals, the lights of their smartphones blending with the glimmer of her sequins on the stage’s big screens.

For a walloping “Wrecking Ball,” Cyrus slipped in “Nothing Compares 2 U,” a cover that, like all the others, came incredibly close to matching the original power of the Sinead O’Connor studio rendition. Then for “Party in the U.S.A.,” a beaming Cyrus collected mementos from fans, including a tank top that read “Diet (Expletive)” she said she’d wear at her next show, and an old Hannah Montana tee she slipped on at the end.

Feeling reᴀssured by the roar of the crowd after such an emotionally challenging beginning, Cyrus ended the night proclaiming that this was “the greatest concert in the world.”

It certainly was the greatest concert of Summerfest 2021.

Wiz Khalifa pinch-hits for The Kid Laroi

For four months, up-and-coming Australian singer and rapper The Kid Laroi, who collaborated with Cyrus on a version of his breakout single “Without You,” was slated to open, but on Tuesday he canceled, with Summerfest sliding Wiz Khalifa into his slot. (Don’t worry, he’s still coming to Milwaukee, Feb. 17 at the Rave.)

Khalifa, you may recall, drew one of the largest crowds ever seen at Summerfest 10 years ago on the Harley-Davidson Roadhouse stage behind his breakout album “Rolling Papers.” He’s been more in dad mode in recent years, starring with his son Sebastian in an Oreo ad and competing as the Chameleon on the latest season of Fox’s “The Masked Singer,” where he made it to the finals (and, frankly, deserved to win).

But Friday he was ready to “Work Hard, Play Hard,” as his hit song goes, starting the set lighting up what can only be described as the Chipotle burrito of blunts.

Apparently, cannabis to Wiz is what spinach is to Popeye, because he became much more animated after taking some deep tokes, playing striptease during “Black and Yellow” before ripping off his shirt for “Sucker for Pain” and channeling Snoop Dogg’s subtle swagger on their collaboration “Young, Wild and Free.”

Sure, he didn’t do any rapping during any of the choruses — preferring to ride the vibe of the recorded verses, the crowd and his three-piece band and DJ. But Wiz handled the verses with aplomb and did a great job warming up Cyrus’ crowd on short notice.

Work hard, play hard indeed.