Ahmed Mohamed, the Texas student who was arrested and suspended from high school for bringing a homemade clock to class, attended a science event at the White House on Monday night.

After the teenager attracted the suspicions of teachers and police with his clock, he received thousands of messages of support on social media — including one from President Obama, who tweeted, "Cool clock, Ahmed. Want to bring it to the White House? We should inspire more kids like you to like science."

Called Astronomy Night, last night's event was held on the South Lawn, where Mohamed, 14, joined several hundred people, including teachers, NASA Administrator Charlie Bolden and scientist Bill Nye, in discussing efforts to explore space, as well as careers in science and technology.

After delivering a speech, the president shook hands with some of those in attendance and spoke briefly with Mohamed. The teenager, who embarked on a wide-ranging tour after his arrest made him famous, did not bring his clock along.

Before the astronomy event, the AP reports, the teenager said his story should teach people a lesson: "Don't judge a person by the way they look. Always judge them by their heart."

At the event, Obama viewed the moon through a telescope, guided by Agatha Sofia "Sofy" Alvarez-Bareiro, a high school senior from Brooklyn, New York.

Calling her to the stage, the president said, "We need you to come up here and help me with this telescope, because I don't know what I'm doing."

Obama also said that NASA is working toward a mission "to send humans to Mars in the 2030s."

Copyright 2016 NPR. To see more, visit http://www.npr.org/.