Over the nine seasons of How I Met Your Mother, myriad guest stars stopped by McLaren's to have a drink with the gang of Ted, Barney, Lily, Marshall, and Robin. Sometimes, these guest stars were friends. Sometimes, they were dates. Some were coworkers. Some simply played themselves!

RELATED: 10 Best How I Met Your Mother Guest Stars Ranked

However, HIMYM also made exceptional use of pop stars turning in acting performances, too. It wasn't just Bryan Cranston or Regis Philbin. It was also a number of singers, who actually ended up fitting in pretty well with the vibe and cast of the series. In fact, some of the most memorable guests were pop stars themselves!

Mandy Moore

Obviously, Mandy Moore has plenty of experience with acting. Between This Is Us and Tangled, Moore is known for her acting just as much as her singing. However, when she played Rapunzel, it was clear that the pop star was still within her.

Moore has seven albums in her discography and she's frequently popped up on a number of charts. "Candy" and "I Wanna Be with You" are some of her top hits. And on HIMYM, her top hit was in giving Ted his butterfly tattoo.

Boyz II Men

Watch Boyz II Men Sing How I Met Your Mother's 'Slap Song'

One of the best recurring jokes on HIMYM revolved around the slap bet. Each time one of Marshall's five slaps would be levied, hilarity would ensue. However, by season nine, the show was still managing to top itself.

RELATED: How I Met Your Mother: 10 Things About Lily & Barney's Relationship That Would Never Fly Today

His song, "You Just Got Slapped" was covered by Boyz II Men at the conclusion of the series' final slap bet. Obviously, their dulcet tones make beautiful work of the melody. The hype was real when Marshall introduced them.

Enrique Iglesias

Enrique Iglesias as Gael and Cobie Smulders as Robin in How I Met Your Mother

"Would you dance if I asked you to dance?" croons Latin pop star Enrique Iglesias on his most famous single, "Hero." This same magnetism and allure are present in Iglesias' role as Gael on HIMYM.

This time, the pop star played a fling of Robin's, as opposed to Ted's. He plays guitar, he's dreamy; they even simulate sailing between him and Robin. Iglesias fit in perfectly during the first episode of season three.

Weird Al Yankovic

Weird al had a cameo in How I Met Your Mother.

Is Weird Al Yankovic a pop star? Perhaps he's more aligned with polka and comedy. However, his ear for pop music is as solid as anyone from Rihanna to Jason Mraz. Therefore, he definitely belongs in the best of HIMYM's musical guests.

RELATED: How I Met Your Mother: 10 Best Flashbacks, Ranked

Weird Al turns up in season seven's "Noretta" episode in a flashback capacity that implies Ted gave him the idea for "Like a Surgeon." This is mostly construed as Ted's general nonsense, but it actually winds up being factual!

Nicole Scherzinger

Robin Sparkles Jessica Glitter

Nicole Scherzinger's greatest claim to musical fame is as the lead singer of the Pussycat Dolls. Since then, she has spawned her brand off across numerous mediums, but she will always be most well-regarded for her time as a pop star.

She even plays a pop star on How I Met Your Mother! As the counterpart to Robin's iconic Robin Sparkles persona (a Canadian teen pop star), Jessica Glitter, Scherzinger was a ton of fun.

Jennifer Lopez

Anita gets flirty with Barney at the bar in How I Met Your Mother

Jenny from the Block has become a mega global superstar, but she still found time to appear in the season five episode, "Of Course." She also makes HIMYM history as the first woman to say no to Barney.

RELATED: How I Met Your Mother: 10 Saddest Things About Barney

Of course, it's no surprise that this transpires because Jennifer Lopez is essentially ethereal. But she also has impeccable timing that makes her a talent across all forms of entertainment.

Carrie Underwood

Ted & Tiffany(Carrie Underwood) | Carrie underwood, How i met your mother, Western music

Obviously, Carrie Underwood is well-known as one of the top stars on the country music scene. However, she's dabbled in more than just country. To win American Idol, one must be well-versed across all genres and Underwood has cut her teeth in pop, as well as in country.

On HIMYM, Underwood portrayed Tiffany, a woman who briefly dates Ted in season five. Surprisingly, Underwood's role in the comedy was her first-ever acting turn. But she was dynamite in the part all the same!

Katy Perry

Zoey's cousin flirts with Barney in How I Met Your Mother

Many times, pop stars turning up on How I Met Your Mother could have been seen as stunt casting. To be fair, these episodes did often prove to be some of the highest-rated. But always, the pop stars who appeared actually turned out to play some of the most memorable characters.

This is definitely true of Katy Perry, who appeared in season six's "Oh Honey." As Zoey's cousin, "Honey" (no one remembers her name), Perry played a gullible - but lovable - ditz and ended up winning a People's Choice Award for her efforts.

Britney Spears

How I Met Your Mother (2005-2014)

On paper, Britney Spears making a small guest arc on How I Met Your Mother would seem like a terrible idea. Quickly, though, Spears proved she had the acting chops as well as the singing chops. Her character on HIMYM was not just one of the best scene-stealing appearances from pop stars on the comedy. It was also one of the best scene-stealing appearances from any guest star.

In season three, Spears turned up twice as Abby, the receptionist who finds herself obsessed with both Ted and Barney. Undeniably hilarious, Britney Spears as Abby is a shimmering example of pop star casting done right.

NEXT: How I Met Your Mother: Why Each Season Is The Best