Ahmed Mohamed joined a group of students, teachers, scientists, astronauts and celebrities -- including the "Myth Busters" and Bill Nye -- for White House Astronomy Night yesterday.
Mohamed had hoped to impress teachers by bringing a clock to his Texas school earlier this year, but was instead reported by suspicious staff who called the police.
A photo of Mohamed standing in handcuffs while wearing a t-shirt with the US space agency NASA's logo was retweeted thousands of times in a matter of hours and "#IStandWithAhmed" became the top trending hashtag on Twitter.
"Cool clock, Ahmed. Want to bring it to the White House? We should inspire more kids like you to like science. It's what makes America great," Obama tweeted.
During remarks at yesterday's event, Obama did not mention Mohamed by name, but spoke about the need for teachers, parents and others to inspire young people.
"We have to watch for and cultivate, encourage, those glimmers of curiosity and possibility, not suppress them, not squelch them," he said.