Prince hatched the idea on Wednesday afternoon: If the Lynx won the WNBA title, he’d host an after-party for them at Paisley Park.

The Lynx did their job at Target Center, and Prince, who attended the game, responded with a three-hour concert — one hour for each of the Lynx’s championships, perhaps — in front of Maya Moore, Seimone Augustus, MVP Sylvia Fowles and others. It was one of Prince’s longest and most joyful performances at Paisley in years.

The Purple One started the party with “Purple Rain” shortly after 12:30 a.m. even though the champs hadn’t arrived yet. Within a few hits including “Let’s Go Crazy,” he was showing his respect, congratulating the Lynx “on a job well done.”

The players arrived in time, swelling the invitation-only crowd of Lynx and Target Center personnel to maybe 150. Augustus wore an orange championship ball cap as she joined dancing machine guard Renee Montgomery onstage. Prince invited several Lynx onstage to dance — and Montgomery proved to be as impressive on the dance floor as she was on the court.

The lengthy opening set was heavy on hits including “Kiss,” “When Doves Cry” and “Hot Thing” (“hot thing, world champs,” Prince sang). Even though the set was improvised with a revamped band (featuring guitarist Donna Grantis of his band 3rdEyeGirl, drummer Kirk Johnson and bassist MonoNeon), Prince seemed as focused as the Lynx had been earlier in the evening.

After two hours of nonstop music, the Lynx were knocked out.

“I didn’t expect this party,” Moore said.

What did she think of the performance?

“Unbelievable.”

Of course, the Lynx didn’t realize it was just halftime.

After 25 minutes of disc spinning from DJ Mike, Prince and his band returned for another set in front of only about 35 people, including two Lynx players with stamina.

Prince told the faithful: “We’re just jamming.”

About three minutes before 4 a.m., Prince, dressed in black with a black stocking cap, bowed, walked off the stage and headed into the crowd. When he got into the middle of the dance floor, he feigned like he was going to fall over from exhaustion. He steadied himself and marched off like a champion.