updated 04/20/2014 AT 1:00 PM ET
•originally published 04/20/2014 AT 2:15 PM ET
When Neil Patrick Harris’s Broadway performance was interrupted by an overzealous fan, the show went on – but not without a little playful improvisation.
Without breaking character, he responded: “I’m doing something up here, motherf—–.”
This earned the How I Met Your Mother alum, 40, a round of applause.
But Harris’s unscripted words were meant to entertain – not offend. When the audience member made the comment, the in-character actor first replied, “Who’s Neil? I’m not Neil.”
“It was all done in good fun and fully in the context of the show,” a rep for Harris tells Gossip Cop. “The audience went crazy, and it really was a light-hearted moment.”
Currently in previews, Harris plays an East German transgender rocker looking for love in a revival of the cult hit that originally opened off-Broadway in 1998 and was made famous on both stage and screen by actor John Cameron Mitchell.