Ahmed Mohamed, 14, was led away in handcuffs from Irving MacArthur High School in North Texas on Monday after bringing the device to his engineering class.
In a tweet, Mr Obama called Ahmed’s clock “cool” and said more students should be inspired like him to enjoy science, because “it’s what makes America great”.
The bespectacled ninth grader has been asked to attend an astronomy night the White House is hosting for top scientists on 19 October.
White House press secretary Josh Earnest said Ahmed had been “failed” by his school, calling the episode a “teachable moment”.
Facebook founder Mark Zuckerberg also invited Ahmed, an aspiring inventor who dabbles in robotics and builds his own radios, to the company’s California headquarters.
“Having the skill and ambition to build something cool should lead to applause, not arrest,” said Mr Zuckerberg.
“The future belongs to people like Ahmed.”
Top NASA engineer Bobak Ferdowsi tweeted that the space agency needs “smart, curious & creative people” like Ahmed.
Ahmed, the son of Sudanese immigrants, said he demonstrated his homework project to his engineering teacher and was advised not to show it to anyone else.
When his digital clock beeped in English class later in the day, he said the teacher confiscated it claiming it looked like a bomb.
The electronics whiz was taken to Irving police headquarters to be questioned, fingerprinted and photographed.
No charges were filed and Irving police say they considered the case closed.
The police department said three teachers at the high school had accused Ahmed of a bomb hoax.
“I built the clock to impress my teacher but when I showed it to her, she thought it was a threat to her,” Ahmed told a news conference on Wednesday.
“It was really sad that she took the wrong impression of it and I got arrested for it later that day.”
The Irving Independent School District stood behind the decision to call the police.
“Out of an abundance of caution, we had to take action,” spokeswoman Lesley Weaver said.
The principal reportedly threatened to expel him unless he made a written statement to police. Ahmed was suspended.
The incident has sparked a huge outcry on social media, where #IStandWithAhmed trended on Twitter.
Democratic presidential candidate Hillary Clinton joined the chorus of support.
“Ahmed, stay curious and keep building,” she tweeted.
His older sisters set up a Twitter account for him, @IStandWithAhmed, which has more than 70,000 followers.
The Council on American-Islamic Relations said the case highlights the climate of hate and fear around the religion.
But Irving Mayor Beth Van Duyne said school officials were simply following protocol.
She made headlines in March when she accused Muslims of plotting to bypass US courts by offering shariah-law mediation to worshippers.
source: Sky News US Team