Katy Perry had one of the best cameos in How I Met Your Mother, and it came at an opportune time for the pop singer. Airing for nine seasons from 2005 to 2014, series creators Carter Bays and Craig Thomas became masters at acquiring scene-stealing guest stars. In addition to notable A-list actors, the CBS sitcom featured appearances by pop culture icons and various musical artists like Perry. The 2011 cameo, however, was a good move for the sitcom and Perry, but it also teased a major film project with a star of How I Met Your Mother.

Perry began her professional music career in the early '00s, reaching fame in 2008 after the release of her second album, One of the Boys. Though she starred in several music videos, the acting side of her career didn't take off until her How I Met Your Mother cameo. Before that, she appeared in the ABC Family drama Wildfire as a club singer. Perry also starred as herself in The Young and the Restless and The Simpsons, in addition to guest judge stints on American Idol, Saturday Night Live, and Extreme Makeover: Home Edition.

Related: How I Met Your Mother: The True Story Behind Regis Philbin’s Cameo

In February 2011, Perry made her guest appearance on How I Met Your Mother during the season 6 episode titled "Oh Honey." Perry played the titular role of Honey, the beautiful cousin of Zoey, who was kind but extremely gullible. Future Ted couldn't remember her real name, but he recalled how he and his friends responded to her remarks by saying, "oh, honey..." so the nickname stuck. Zoey originally set her up with Ted until she ended up spending the night with Barney. As the case with guest appearances from Britney Spears, Jennifer Lopez, and Nicole Scherzinger, it was a major deal to score a cameo from Perry. How I Met Your Mother knew Perry's involvement would score fans, but the casting also did wonders for the singer during a pivotal time in her career.

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

Following the success of One of the Boys, Perry released her third studio album, Teenage Dream, in August 2010. The chart-topping album ended up producing five number-one singles. Within three years, Teenage Dream sold over six million copies worldwide. When Perry booked her guest role on How I Met Your Mother, she was at the peak of Teenage Dream's popularity. Not only was CBS happy to feature one of the most in-demand musical artists in a comedic role, but Perry was also thrilled with getting more exposure while her album continued breaking records.

Perry's cameo as Honey in How I Met Your Mother was well received by critics. She even won an award for the Favorite TV Guest Star at the People's Choice Awards. A few months after appearing in the sitcom, Perry made her first professional film role, voicing Smurfette in The Smurfs. She worked alongside How I Met Your Mother's Neil Patrick Harris, who very well could have helped urge the singer to agree to take the TV role as Honey. She and Harris reprised their roles in 2013's The Smurfs 2. Though Perry only starred in one episode of How I Met Your Mother, the series will always be a piece of her acting legacy.

More: Why How I Met Your Mother Killed Off The Mother (Despite The Show's Title)