Justin Timberlake and Selena Gomez Close Out Taylor Swift's Final '1989' L.A. Show in Epic Style!

T. Swift also brought out Lisa Kudrow, as her 'Friends' character, for the finale.

Taylor Swift's sold-out shows at the Staples Center have been blockbuster nights, jam-packed with the singer’s famous friends and musical idols. Wednesday night's L.A. finale closed out the tour stop in epic fashion, as Taylor promised "some of the most epic surprises on the 1989 World Tour."

"You went and broke this crazy record for the most amount of sold-out shows here," Swift told the crowd, referencing the banner that Lakers’ star Kobe Bryant helped present at Friday night’s concert. "Thank you."

NEWS: Taylor Swift Continues to Surprise on '1989' L.A. Tour Stop, Duets With John Legend!

And Swift more than delivered, with a personal favorite as her final, epic special guest.

"This has been so hard to keep a secret," she told the crowd. "Anyone who knows me knows this is my favorite artist."

The guest of honor? Justin Timberlake.

WATCH: Taylor Swift Rocks Third L.A. Show, Brings Out Surprise Guests Alanis Morissette & Ellen DeGeneres!

Timberlake, who took the stage for the first time since the birth of son Silas back in April, joined Swift in a performance of his hit "Mirrors."

Following their show-stopping duet, Swift acknowledged Timberlake’s exciting return to the stage.

"Tonight has been eventful for me at least. Justin hasn't performed since he became a dad and I'm so honored that this was his first performance back," Swift said afterward. "He has given me so many incredible pieces of advice... I just am so happy he would dedicate his night to coming out and playing for you guys. He's just the best -- that's why he's my favorite."

WATCH: Taylor Swift's Second Night in L.A. Brings Surprise Guests Mary J. Blige & Uzo Aduba

Swift also thrilled the crowd by bringing out bestie and "Bad Blood" co-star Selena Gomez as the first special guest of the night.

"She has the song of the summer on the radio right now!" Taylor announced before the two launched into Gomez’s new single "Good for You." The performance was extra special, Swift told the crowd, as it was the first time Gomez has performed the new song on-stage.

PICS: Taylor Swift Kicks Off Her L.A. '1989' Tour Stop With Kobe Bryant, Ryan Tedder and More!

Swift also welcomed an unusual guest to the stage with a rather cryptic intro.

"This girl, she’s only ever played in coffee houses before," she told the sold-out crowd. "Please make her feel welcome."

Then, Friends star Lisa Kudrow came out as her character Phoebe Buffay, so the two could perform a duet of Phoebe’s classic song "Smelly Cat!"

MUSIC: 11 Feelings You Will Feel at a Taylor Swift Show

Taylor even thrilled the crowd with her special song selections on Wednesday, performing "Mean" on the elevated "B-stage" to a packed crowd of screaming fans.

PICS: Taylor Swift Brings Kendall Jenner, Serena Williams and More Onstage During Concert

Orange Is the New Black
star Ruby Rose and her friends, as well as Big Brother host Julie Chen and her husband Les Moonves, snapped pics with Swift backstage.

WATCH: What's the Secret Behind Taylor Swift's Unstoppable Power?

Timberlake’s wife Jessica Biel, Bleachers singer (and Lena Dunham’s BF) Jack Antonoff, who co-wrote "Out of the Woods" and "I Wish You Would" with Swift, and actress Miranda Cosgrove were also spotted in the crowd.

Swift’s reported beau Calvin Harris was also back at Staples Center to support his girl.

Sophie Schillaci contributed to this report.

WATCH: How Taylor Swift Is Headed for World Domination With Her '1989' Tour