Image copyright Getty Images Image caption The whole Mohamed family will move to Qatar

Ahmed Mohamed, a 14-year-old Muslim boy from Texas whose teacher mistook his homemade clock for a bomb, will move to Qatar with his family.

Ahmed has accepted a scholarship from the Qatar Foundation for Education, Science and Community Development, where he will study.

He met US President Barack Obama at the White House on Monday.

After Ahmed was detained over the clock last month, his case went viral on social media.

Some alleged he was unfairly treated because of his name and religious background. Officials in Irving Texas defended their decision, saying they were only concerned with the safety of students.

The Qatar Foundation is providing a full scholarship for his secondary and undergraduate education, according to a news release.

Media playback is unsupported on your device Media caption Ahmed Mohamed meets US President Barack Obama

"Our family has been overwhelmed by the many offers of support we have received since the unfortunate incident of Ahmed's arrest," the Mohamed family said in the release. "From the White House to Sudan, to Mecca, we have been welcomed by a variety of individuals, businesses and educational institutions."

According to his family, Ahmed will be enrolled in the Qatar Foundation's "Young Innovators" program and his whole family will relocate with him to Qatar.

"Qatar was a cool place to visit. I loved the city of Doha because it's so modern. I saw so many amazing schools there, many of them campuses of famous American universities," said Ahmed in the news release. "The teachers were great. I think I will learn a lot and have fun too."'

Image copyright Reuters Image caption Ahmed's homemade clock was mistaken for a bomb

Ahmed withdrew from his Texas school shortly after the clock incident.

He was arrested on 14 September after his teacher mistook his clock for a bomb, sparking outrage and the trending hashtag #StandWithAhmed.

In addition to being invited to the White House, Ahmed received an outpouring of support from scientists, politicians and celebrities including Facebook CEO Mark Zuckerberg.

Who Ahmed has met

Image copyright AFP

US President Barack Obama

Google co-founder Sergey Brin

Turkish Prime Minister Ahmet Davutoglu

Sudanese President Omar al-Bashir

National Geographic Society CEO Gary Knel (above)

Queen Rania of Jordan

Mashable CEO Pete Cashmore

Just what is a 'suspicious' object?