WASHINGTON (AFP) - US President Barack Obama on Wednesday invited a Muslim schoolboy to the White House after he was arrested and dragged off in handcuffs for bringing a homemade clock to class.

Obama congratulated 14-year-old Ahmed Mohamed on his skills and issued a presidential invitation, in what amounts to a pointed rebuke to school and police officials who precipitated his arrest.

"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," the President 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. — President Obama (@POTUS44) September 16, 2015

Assumptions and fear don't keep us safe—they hold us back. Ahmed, stay curious and keep building. https://t.co/ywrlHUw3g1 — Hillary Clinton (@HillaryClinton) September 16, 2015

The White House invitation was shortly afterwards followed by an invitation from Facebook chief executive Mark Zuckerberg to visit the social media network's offices.

The teen was led out of his Texas school after a teacher mistook his homemade digital clock for a bomb, prompting accusations of Islamophobia and an online backlash.

A photo of Ahmed 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" was the top trending hashtag on Twitter.

Related Story Muslim boy arrested for bringing clock to Texas school

Among those voicing support for the boy was Hillary Clinton, who tweeted: "Assumptions and fear don't keep us safe - they hold us back. Ahmed, stay curious and keep building."

"My hobby is to invent stuff," the boy told The Dallas Morning News in a video posted on the paper's website that was filmed in his electronics-filled bedroom.

"I made a clock. It was really easy. I wanted to show something small at first... they took it wrong so I was arrested for a hoax bomb."