The cast and crew of Nickelodeon's hugely popular sitcom "iCarly" found this out when the first lady filmed a guest appearance for an episode that airs Monday night. She greeted people on the Hollywood set as if they were old friends, series' creator Dan Schneider said, in spite of the buttoned-down Secret Service bubble around her.

"I'd planned to keep a respectful distance so no security people would wrestle me to the ground or Tase me," said Schneider, also "iCarly's" executive producer. "But she was so warm and down-to-earth, not intimidating at all. She hugged me and said how excited she was to be on the show."

Obama, a visible first lady who's no stranger to television cameos, chose "iCarly" for her scripted TV debut. It turns out that she's a longtime fan who watches the show with daughters Malia and Sasha – the president has peeked in on a few episodes too – and contacted the production about being written into the series, Schneider said.

"iCarly's" setup made it possible for Obama to champion one of her pet causes: honoring military families. The title character, Carly Shay, is the daughter of a U.S. Air Force colonel who's been deployed since the show launched in 2007.

Fans of the series have never met Col. Shay, knowing just that he's away on active duty and that high schooler Carly, played by teen star Miranda Cosgrove, lives with her older brother, Spencer.

Though the series usually sticks with wacky and light-hearted plot lines – Schneider likens it to "ice cream and roller coasters" – there was an opportunity with the first lady's appearance to do something more substantive, he said.

"Ours is a very broad and silly show, but we had the chance here to put out a really positive message about supporting military kids," Schneider said. "We tried to do that without being heavy-handed or preachy."

The episode, dubbed "iMeet the First Lady," has Carly and Spencer prepping for a birthday party for their dad, who's expected to finally come home. But his plans get derailed and Carly's friends try to cheer her up by arranging a father-daughter reunion via the Internet. They film the exchange and use it on Carly's online series "iCarly," catching the attention of Homeland Security and laying the groundwork for Obama's surprise visit.

Meta alert: the on-air first lady watches "iCarly," just like the real one, and decides to drop in on the gang. In the script, Obama tells the kids how impressed she was by how they rallied around Carly.

The real Obama, meanwhile, said in a statement to The Times that she wanted to speak "directly to young people and show them how much admiration and respect we have for kids and teenagers who grow up in military households. These young people are serving our country, just like their parents."

Marjorie Cohn, Nickelodeon's president of original programming and development, said there are few thrills, Emmy wins included, that compare with getting a White House request like Obama's, and she hopes the much-hyped appearance translates to fat ratings.

But the episode, which the cast is screening at several military bases around the country in advance of the TV premiere, is an accomplishment in itself, Cohn said.

"It has a lot of heart, a lot of emotion, and talks about a serious issue in a way that will resonate with kids but not be over their heads," she said.

The series, which will hit 100 episodes in the near future, continues to be a ratings force on the kids network, drawing about 2.3-million viewers an episode, according to Nielsen, making it the top cable show for kids ages 6 to 11 and 9 to 14. A special episode last spring drew 7.4-million viewers.

Obama spent nearly four hours last summer on the "iCarly" set on Sunset Boulevard, knew her lines and "nailed it" with minimal retakes, Schneider said. Even though she was playing herself, she still had to do some acting, and Schneider said she has pretty decent comedy chops.

Fans can look forward to seeing Obama shake a leg during the "random dancing" segment.

"We'd asked if she would be OK with really mixing it up and having fun," Schneider said. "There was no apprehension on her part at all. She was a totally good sport."

The first lady, like many political figures today, has made appearances on live talk shows and entertainment specials. She participated in a salute to pop princess Beyoncé at the "Billboard Music Awards" in May and was on the military-themed season premiere of ABC's "Extreme Makeover: Home Edition" last fall. And like a number of other first ladies, she's done the "Sesame Street" circuit. Barack Obama, high profile beyond the 24-hour news cycle, has been a guest on late-night talk shows and Discovery Channel's "MythBusters."