The Character Everyone Forgets Lin-Manuel Miranda Played On HIMYM

Over the course of its nine season run, "How I Met Your Mother" had more than its fair share of guest stars, including Wayne Brady, Bryan Cranston, and Katy Perry. But even the most dedicated fans may forget that Lin-Manuel Miranda guest-starred on "How I Met Your Mother" in the show's final season. His role is particularly notable because it occurred pre-"Hamilton," when only dedicated Broadway fans knew who the Tony-winner was.

The episode in question is Season 9's "Bedtime Stories," an ambitious half-hour centered on Marshall's bus journey to Farhampton with baby Marvin for Robin and Barney's wedding. Poor Marshall belatedly realizes taking an infant on a long, bumpy bus ride wasn't his best plan, and he resorts to telling the baby rhyming stories to keep him calm. Soon, all of the passengers get in on the act, including Miranda, who plays Gus, the man sitting across from Marshall.

While the comedy would have been well within its rights to make Miranda's character a theater guy, he's actually just a regular Joe who happens to be skilled at dropping rhymes. His most impressive moment comes midway through the episode, when he raps about how Canada is an unrhymable word — at least it is for most people. Gus eventually rhymes it with "janitor" of all things in the episode's biggest mic drop moment.

How did Lin-Manuel Miranda end up on How I Met Your Mother in the first place?

At this stage in Miranda's career, he was already an award-winning lyricist, but he hadn't yet become a household name. In fact, his "How I Met Your Mother" episode was his final TV show appearance for three years. When he returned for an episode of Hulu's "Difficult People" in 2016, "Hamilton" had made him a certified star.

Since he was mostly only known to musical theater fans in 2013, Miranda may seem like an odd choice to guest star on "How I Met Your Mother," even in a rhyming episode. But in retrospect, his scene-stealing turn makes perfect sense. After all, the Tony winner is a Wesleyan alum just like the sitcom's creators, Carter Bays and Craig Thomas.

Although Miranda didn't graduate the same year as Bays and Thomas, they all became friends afterwards. In fact, in his tweet announcing Miranda's guest appearance, Bays referred to him as their "good friend," as reported by SpoilersGuide. According to The A.V. Club review of the episode, the famed Broadway star had previously collaborated with the duo on a "One More Day" parody during the show's TCA presentation.

Basically, Bays and Thomas knew Miranda was cool long before "Hamilton" took Broadway by storm. And thanks to their clever casting, the acclaimed actor-lyricist-director was able to lend his talents to one the show's final stand-out episodes.