Credit: Zach Lipp/AdMedia

Neil Patrick Harris is embracing the news that Britney Spears will appear on his CBS sitcom How I Met Your Mother — and he’s also having some fun with the idea.

“I was shocked that Madame Spears was willing to come and do some acting,” Harris, 34, tells Entertainment Tonight. (See the video here.)

Noting “she hasn’t acted in a while,” Harris goes on to say, “This is a very interesting role. It is very not like her at all in real life in any of her previous chapters.”

In April 2006, Spears guest-starred on NBC’s Will & Grace as a two-faced conservative talk-show host alongside Sean Hayes’s flamboyant character Jack.

On How I Met Your Mother — set to air March 24 — “She plays the secretary to another girl that Ted Josh Radnor is after. So, it will be very unlike any Britney we have seen before, and we have seen a lot of Britney recently.”

Harris also tells ET that paparazzi will not be a problem when Spears, 26, shows up, because the series is shot on the secure FOX lot.

But he jokingly muses: “What if she shows up on set and she is absolutely, totally normal and that whole thing has been a big ruse?”

As he imagines it, “She is smoking a cigarette and says, ‘Oh yes, it is all a big bit. I have a master plan.’ ” –Stephen M. SilvermanZach Lipp/AdMedia