Barack Obama has invited Ahmed Mohamed, the 14-year-old Muslim student who was arrested in Texas for bringing his homemade clock to school after it was mistaken for a bomb, to the White House. The US president made the offer on Twitter.

Obama tweeted:

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. September 16, 2015

Ahmed made the clock, a circuit hologram case stuffed with circuits, and brought it to MacArthur High School in Irving in a bid to impress his engineering teacher. Instead, he was arrested and led to a juvenile detention centre after another teacher saw it and alerted school authorities who called the police.

Later on, Irving police chief Larry Boyd said the 14-year-old would not be charged with any wrongdoing because of lack of evidence "to support that there was an intention to create alarm or cause people to be concerned". The incident triggered a heated reaction on social media, with #IStandWithAhmed going viral on world trends.

Ahmed's sister told me to post this. Yes this situation is real for those questioning. pic.twitter.com/Oxd0JxUS6O — Prajwol/Ru (@OfficalPrajwol) September 16, 2015

Ahmed said he loves engineering and wanted to impress his teacher with his homemade digital clock. But the teacher, after congratulating him, advised him not to show it to any other teachers. Dallas Morning News reported that another teacher saw the device and said it looked like a bomb, to which the teenager responded: "It doesn't look like a bomb to me."

Five police officers interrogated Ahmed after he was pulled out of class. He said they searched through his belongings before he was transported to the juvenile detention centre, where his fingerprints and mugshots were taken. In a video interview, Ahmed described the humiliating experience, saying: "It made me feel like I wasn't human. It made me feel like a criminal."

His father Mohamed Elhassan Mohamed, who is originally from Sudan, said his son had been mistreated because of his name "and because of 11 September".