Lin-Manuel Miranda returned Monday to the room where it happened. And, at the behest of first lady Michelle Obama, he brought the entire cast of his mega-hit musical, “Hamilton,” to that room — the East Room of the White House.

It was in the East Room seven years ago that “Hamilton” had its first out-of-town tryout of sorts. Invited to perform at a White House poetry slam, Miranda gave the first public performance of a song from the show, then called “The Hamilton Mixtape,” that he had only begun to write. That hip-hop number, “Alexander Hamilton,” would in fact become the prologue of the groundbreaking musical, for which Miranda would compose more than 30 other songs, including such popular numbers as “Helpless” and, yes, “The Room Where It Happens.”

Michelle Obama, who has seen the show twice — once in its initial off-Broadway run at the Public Theater and again after it moved to Broadway last summer — long lobbied the show’s creators to pay a visit to the White House and have cast members participate in an education program and sing selections from the show for local students. Finally, that day came. On Monday afternoon, dozens of excited area high-schoolers gathered at the White House, where the first lady recounted meeting Miranda at the 2009 poetry slam and being surprised when he told her what he planned to perform.

“He said, ‘I’m going to do a piece about Alexander Hamilton,’ ” she recalled. “Now Barack and I, we’re open-minded. But we looked at each other like, ‘Okay, this should be interesting.’ ”

“Of course,” she added, “we were blown away.”

Actor Daveed Diggs, right, watches as actor Lin-Manuel Miranda hugs first lady Michelle Obama during the visit by the Broadway cast of “Hamilton” to the White House. (Evan Vucci/AP)

“Blown Away” could have been the subtitle of Monday’s gathering: The students, from schools including Laurel High School in Maryland, Osbourn High School in Manassas, Va., and Loudoun County High School in Virginia, screamed loudly when Obama made her entrance, but they were even louder when Miranda, the musical’s star, was introduced, along with cast members Daveed Diggs (who plays Thomas Jefferson), Phillipa Soo (Eliza Hamilton) and Christopher Jackson (George Washington).

The Obamas have emerged as a more fervent team of boosters for a Broadway show than any occupants of the White House in recent memory. (President Obama saw it last summer, too.) In fact, the first lady described “Hamilton” as “the best piece of art in any form I have ever seen in my life.”

How’s that for an endorsement?

The first lady was clearly hoping that some of Miranda’s passion would rub off on the teenagers. “I think you are some of the luckiest young people on the planet,” she said, as they applauded.

Later in the afternoon, the cast performed selections from the musical in the East Room after a series of student performance workshops led by Miranda and the actors, as well as a question-and-answer session.

Sitting behind Obama during her opening remarks, Miranda looked slightly embarrassed by the lavish praise. “Thank you for moving mountains to be here,” she told him. When he took the microphone, he received a thunderous reception from the students.

“Hi, guys, I’m Lin Miranda. What we’re really here to do is play with you guys,” he said. Soon, the students were split up and led into separate rooms for sessions with the “Hamilton” cast.

Jeffrey Seller, the show’s lead producer, said the students were asked to prepare their own performance pieces — poetry, rap or short plays — and base them on a figure or an event from the American Revolution. The concept was, aptly enough, getting its tryout at the White House: It will be rolled out again by the production in the coming weeks, with 20,000 New York high school students getting tickets to “Hamilton” through a grant from the Rockefeller Foundation.

“This has been an obsession of the first lady’s since soon after she first saw the show,” Seller said. “She said, ‘We would love for you to come to the White House for an education program.’ But we didn’t yet have an education program!”

Seller, one of the original producers of “Rent,” wasn’t surprised by the students’ enthusiastic reception. “They all know ‘Hamilton’ from the CD,” he said. “I’ve never seen a musical reach its target audience so fast.”

In the question-and­answer session, a young woman from Laurel High School wanted to know about the casting of “Hamilton” and why so many actors of color were hired to portray the white men and women who fill Alexander Hamilton’s own story.

“The reality was we wanted to eliminate any distance between then and now,” said Thomas Kail, the Alexandria, Va., native who directed “Hamilton.” “If the world looked like now and sounded like now, [the show] could build a bridge,” he said.

Judging from the electric atmosphere in the East Room, that bridge is solidly in place.