How I Met Your Mother
How I Met Your Mother creators apologise to viewers after ‘racist’ episode Kwintin / Flickr

The creators of hit CBS sitcom How I Met Your Mother have apologised for their latest episode after it was branded racist.

The episode, aired on 13 January, titled Slapsgiving 3: Slappointment in Slapmarra, showed Barney Stinson ( Neil Patrick Harris) receiving the final slap from Marshall Eriksen (Jason Segel). His martial arts "teachers" were played by cast members Lily (Alyson Hannigan), Ted (Josh Radnor) and Robin (Cobie Smulders), who were in Asian attire and makeup.

Outraged viewers accused them of "yellowface" and the hashtag #HowIMetYourRacism started trending on Twitter.

Rania Khalek: "Btw, the only regular character of color on #HowIMetYourRacism is their Bangladeshi cab driver (old/foreign/dumb/brown/pervert stereotype)"

Adrienne K.: "Wow, just watched about 10 seconds of #HowIMetYourRacism and already can't handle it. Stereotyping, yellowface, and orientalism 101. Nope."

Khodadad Rezakhani: "yellow-faces & #FuManchu mustaches are not really Asian. They are like berets for the French. Don't take offense! #HowIMetYourRacism #HIMYM"

Kaaren Meelon: "If you're going to make fun of Asian people and kungfu, at least use Asian actors on your show instead of whitewashing it #HowIMetYourRacism"

Carter Bays, one of the show's writers, took to Twitter, and said that he and fellow co-creator Craig Thomas were "deeply sorry" to those who were offended by the episode.

"With Monday's episode, we set out to make a silly and unabashedly immature homage to Kung Fu movies, a genre we've always loved," he wrote. "But along the way we offended people. We're deeply sorry, and we're grateful to everyone who spoke up to make us aware of it."

"We try to make a show that's universal, that anyone can watch and enjoy. We fell short of that this week, and feel terrible about it," he continued. "To everyone we offended, I hope we can regain your friendship, and end this series on a note of goodwill. Thanks."