How I Met Your Motherwas considered a later generation’sFriendsand had the iconic guest stars to prove it. But more than famous faces in acting, theCBShit gave viewers several appearances by stars of the music world, and even became the home to some of their acting debuts.

RELATED:‘How I Met Your Mother’ Cast and Characters (And What They’re Doing Now)

Neil Patrick Harris and Britney Spears wearing matching blue sweaters on How I Met Your Mother

From popstars and boy bands to an American Idol and a Broadway sensation,HIMYMoffered up the goods when it came to soundtrack, as well as the unexpected acting abilities of some of music’s finest.

Britney Spears As Abby

It wasn’t uncommon for music megastarBritney Spearsto make guest appearances in film and television during the height of her career, but it still made major headlines when the “Toxic” singer guest-starred on this CBS sitcom.

For two episodes in Season 3, Spears played Abby, a receptionist at Ted’s girlfriend’s dermatology office who develops a crush on Ted, but later falls into bed with Barney and pretends to be in love with him in order to get back at Ted for turning her down.

Carrie Underwood On How I Met Your Mother With Neil Patrick Harris And Josh Radnor

Carrie Underwood As Tiffany

American Idolcontestantshave been making the leapfrom Grammy winners to Oscar hopefuls for years, and Season 4 winnerCarrie Underwoodmade her acting debut in 2010 onHow I Met Your Mother.

Underwood played Tiffany, the girl who strung Ted along while still dating her current boyfriend in the Season 5 episode “Hooked.”

Enrique Iglesias feeding Robin in Argentina

Enrique Iglesias As Gael

While the King of Latin Pop’s résumé as an actor is small, his 2007 role inHow I Met Your Motheris a memorable one.

Enrique Iglesiasplayed Gael, the hot Argentinian ex-boyfriend of Robin who she dated after her breakup with Ted. The singer appeared on two Season 3 episodes, and even serenaded the characters with a song called “Somebody’s Me.”

Nicole Scherzinger on How I Met Your Mother

Nicole Scherzinger As Jessica Glitter

From cameos as herself on shows likeBig Time RushandMy Wife and Kidstovoicing a characterinMoana,Pussycat Dollsalum andThe Masked SingerjudgeNicole Scherzingeris no stranger to acting and played a notable character onHow I Met Your Mother.

RELATED:‘How I Met Your Mother’ Should Have Been Nicer to Robin

Katy-Perry with the whole “How I Met Your Mother” gang and Zoey.

Scherzinger portrayed Jessica Glitter, the fellow Space Teen cast member and former best friend of Robin, during her Robin Sparkles days, who shows up in a Season 6 episode to patch things up with her old “best friend forever.”

Katy Perry As Honey

Back during the early stages ofKaty Perry’smegastar career, at the same time she was starring as Smurfette inThe Smurfsfilm, the “I Kissed A Girl” singer made a guest appearance onHIMYM.

Perry made her on-screen acting debut as Honey, the beautiful but ditzy cousin of Ted’s girlfriend Zoey who is so gullible that her nickname stemmed from everyone’s reaction to her: “oh, honey.”

Boyz II Men As Themselves

It wasn’t a first for this 90s R&B group to make acameo on a sitcom,but it had to be a first when it came to the song they performed onHow I Met Your Mother.

Boyz II Menunexpectedly showed up on a Season 5 Thanksgiving episode, rightfully titled “Slapsgiving 2: Revenge of the Slap,” where they put a B2M twist on the song “You Just Got Slapped,” originally performed in the third season’s “Slapsgiving” episode by Marshall.

Mandy Moore As Amy

Before starring as Rebecca Pearson on theNBChitThis Is Usor lending her voice to Rapunzel inTangled,actress and singerMandy Mooremade a guest appearance on the Season 3 premiere ofHIMYM.

RELATED:‘This Is Us’ Series Finale Explained: A Poignant Farewell to the Pearsons

Moore played Amy, who is described as a tattooed girl that Ted hooks up with; the one who convinces him to get a butterfly tattoo and leads him to find love with Stella, his dermatologist who eventually removes his regrettable ink.

Weird Al Yankovic As Himself

Weird Al Yankovichas had a long and eclectic career when it comes to cameos, spanning fromRob Zombie’sHalloween IItoDisney Channel’sLilo and Stitch: The Series.And in 2011, Yankovic addedHow I Met Your Motherto that growing list.

The performer appeared in a Season 7 episode where a flashback confirms that some old fan mail from Ted gave Yankovic the idea for his song parody “Like A Surgeon.”

Lin-Manuel Miranda As Gus

Of all the guest appearances and cameosHow I Met Your Motherhad in its nine seasons, this one has got to bethe most surprising.

Long before Hamilton, Broadway virtuosoLin-Manuel Mirandaguest-starred in the Season 9 episode “Bedtime Stories,” during which Marshall tells a rhyming bedtime story to his son with the help of Miranda’s character Gus in this creative episode where the entire script rhymed.

Jennifer Lopez As Anita Appleby

Despite her rise to fame as a singer,Jennifer Lopezhas made a name for herself as an actress with notable roles inSelena, Shall We Dance?,Marry Me,and a memorable part inHow I Met Your Mother.

Lopez guest-starred on Season 5 as Anita Appleby, a famous author who gets set up by Robin and almost taken on what’s referred to as a “Super Date” by Barney until he gives it all up, so Robin can go on the date she deserves.

NEXT:‘How I Met Your Mother’: Best Things Ted Mosby Taught Us