President Obama and first lady Michelle Obama host a group of Girl Scouts from across the country for a campout on the South Lawn of the White House June 30, 2015. (Photo by Chip Somodevilla/Getty Images)

President Obama posed a simple question to the roughly 50 Girl Scouts camped out on the South Lawn Tuesday night: "What are you guys doing in my yard?"

Michelle Obama -- who serves as honorary national president of the Girls Scouts -- engineered the event, which was co-sponsored by the Interior Department and billed as the first-ever White House Campout. The White House grounds are part of the national park system.

On Tuesday afternoon as the scouts settled in for the night, the first lady had emphasized the event's more serious side. She spoke of the upcoming National Park Service centennial next year, as well as the administration's effort to encourage every fourth grader to visit national parks with their families, for free.

[READ: Obama launches "Every kid in a park" initiative]

"You are making history. This is something you can tell your kids and your grandkids. Do you understand the impact," she asked, as the kids laughed, "the importance of this moment, today?"

The girls -- who will be starting fifth grade in the fall -- engaged in a variety of activities, including rock wall climbing, knot tying and tent pitching. NASA astronaut Cady Coleman also joined the group to help lead a stargazing activity on the South Lawn with other NASA staff and scientists.

But by the time she returned with her husband in tow, at 8:29 p.m., the president was eager to crack camping jokes as the kids huddled around electric lanterns that substituted for a campfire.

"When did you guys show up?" he quipped, wearing jeans and an open-collared shirt. "I don't know what you guys are doing here."

Obama also questioned how the scouts could have engaged in rock climbing on the South Lawn. "Where did you go rock climbing?" he asked, prompting laughter. "There are no rocks over there."

Sitting next to a Girl Scout on one bale of hay, while the first lady sat next to another one on a separate bale, the president praised the group's singing.

"Fantastic. That was outstanding," he said after one round of campfire songs. "You guys sound pretty good."

After one of the Girl Scouts proposed that they could be on TV, the president --who noted his wife was "rocking out a little bit" during one tune, replied, "You could go on America's Got Talent? Maybe."

At one point the campfire leader told her scouts President Obama was "our sister too," prompting him to say he was instead a "brother." Undeterred, the leader told the president he was "very in touch with your feminine side. That's what makes you so wonderful."

"Clearly," the president deadpanned.

Obama did note that the event had a larger message: young people need to spend time outside in places like national parks rather than staying inside and watching TV.

"I think the reason you guys are here is because we're celebrating the Great Outdoors and the National Park Service is trying to make sure that young people get outside -- so you guys aren't watching TV all the time, or playing video games all the time, but you're getting outside, getting some fresh air and spending time with your friends and having adventures," he said.

After getting a group hug, the president gave the scouts a final warning.

"I'm so glad you guys are having fun. But I want to make sure -- you guys better clean up this mess," he said, sparking another round of laughs. "When I wake up in the morning -- I'm teasing.  You guys aren't going to be making a racket, are you?"

"Yes!" the kids cried out in response.

8:03 a.m. update: Rain and thunder washed out the campout late Tuesday night. The girls had to move from their pitched tents on the lawn to a conference room in an office building near the White House, according to the first lady's office. The Girl Scouts did sleep outside – briefly – and then were moved inside before they got wet.