How Cobie Smulders' 'How I Met Your Father' Cameo Was Kept a Secret From the Cast (Exclusive)

The actress reprised her 'How I Met Your Mother' character on the Hulu series.

How I Met Your Father's epic season finale cameo was kept secret -- even from the cast! ET's Cassie DiLaura spoke with the cast of the Hulu series about how How I Met Your Mother alum Cobie Smulders' appearance was kept quiet among their group.

Smulders, who played Robin Scherbatsky on HIMYM, popped up on the finale as her past character, eager to offer some much-needed advice to Hilary Duff's Sophie, amid Jesse's (Chris Lowell) early declaration of feelings, and his love triangle with her and his ex, Meredith (Leighton Meester).

"I think there's no better person than Cobie to give Sophie that boost of confidence that she needs in that moment," Duff told ET. "She's iconic, all the cast is, so for her to jump on board and just be there for us, it really was a dream come true."

"She was great. She made me very comfortable," Duff added. "... We have a lot of the same crew that worked on How I Met Your Mother... for her to be there, it was like a family seeing each other that hadn't seen each other in a long time."

With Duff being Smulders' main scene partner, the rest of the cast was largely left in the dark -- and off of the set -- the day the HIMYM alum was filming her scenes, a fact that Francia Raisa joked was "very rude."

"They kept that so under wraps," Lowell said of Smulders' cameo. "Her scenes weren’t even in the script. It was like a deep confidentiality. No one even spoke about it."

While most the cast knew about Smulders' appearance ahead of time, Lowell noted that they all went to great lengths to keep the "juggernaut surprise" a secret from viewers.

"We wouldn’t even ask questions about it, just to keep it from spilling out," he revealed.

Tien Tran, who plays Ellen on the show, found out about the special guest star when she walked onto the set "and the bar was there and I was like, 'Oh, this is happening now. I can't believe it.' And then we heard who was coming and I was like, 'People are gonna love it.'"

Tom Ainsley agreed that the cloak-and-dagger antics were "rightly" put in place, quipping, "I have a very large mouth and will tell anyone anything." Eventually, though, Ainsley, who plays Charlie on the show, found out about Smulders' appearance in the same way Tran did.

"I didn't even know those scenes were taking place until I was walking through one of the studios and thought that I recognized this as MacLaren's," he told ET. "I spent the rest of the day asking people what was going on and they just kept denying it to me." 

As for what season 2 has in store, Duff said that she hopes Smulders' cameo is one of many to come.

"I really hope that we get everybody at some point throughout our, hopefully very long, run of a show," Duff said of the rest of the HIMYM cast. "... To have the opportunity to keep telling this story... that's amazing and that really gives a big confidence boost to what we're doing... It's freaking amazing."

Season 1 of How I Met Your Father is now streaming on Hulu.